diff -Nru rust-curl-0.4.25/Cargo.lock rust-curl-0.4.33/Cargo.lock --- rust-curl-0.4.25/Cargo.lock 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.33/Cargo.lock 2020-08-19 05:24:59.000000000 +0000 @@ -0,0 +1,816 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aho-corasick" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" + +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +dependencies = [ + "byteorder", +] + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "bumpalo" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] +name = "cc" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66120af515773fb005778dc07c261bd201ec8ce50bd6e7144c927753fe013381" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "cmake" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e56268c17a6248366d66d4a47a3381369d068cce8409bb1716ed77ea32163bb" +dependencies = [ + "cc", +] + +[[package]] +name = "curl" +version = "0.4.33" +dependencies = [ + "anyhow", + "curl-sys", + "libc", + "mio", + "mio-extras", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2", + "winapi 0.3.9", +] + +[[package]] +name = "curl-sys" +version = "0.4.36+curl-7.71.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68cad94adeb0c16558429c3c34a607acc9ea58e09a7b66310aabc9788fc5d721" +dependencies = [ + "cc", + "libc", + "libnghttp2-sys", + "libz-sys", + "mesalink", + "openssl-sys", + "pkg-config", + "vcpkg", + "winapi 0.3.9", +] + +[[package]] +name = "enum_to_u8_slice_derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8479a225129affae259452fd418b67af025ac86f60663a893baa407bc9897f43" +dependencies = [ + "quote 0.3.15", + "syn 0.11.11", +] + +[[package]] +name = "env_logger" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "hermit-abi" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" +dependencies = [ + "libc", +] + +[[package]] +name = "humantime" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +dependencies = [ + "quick-error", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" + +[[package]] +name = "libnghttp2-sys" +version = "0.1.4+1.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "libz-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af67924b8dd885cccea261866c8ce5b74d239d272e154053ff927dae839f5ae9" +dependencies = [ + "cc", + "cmake", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" + +[[package]] +name = "mesalink" +version = "1.1.0-cratesio" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05616fdd96cc48e233f660ce28e936950163b21f28bde25649acf55de411970a" +dependencies = [ + "base64", + "bitflags", + "enum_to_u8_slice_derive", + "env_logger", + "lazy_static", + "libc", + "parking_lot", + "ring", + "rustls", + "sct", + "untrusted", + "walkdir", + "webpki", + "webpki-roots", +] + +[[package]] +name = "mio" +version = "0.6.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +dependencies = [ + "cfg-if", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "mio-extras" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +dependencies = [ + "lazycell", + "log", + "mio", + "slab", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "net2" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +dependencies = [ + "cfg-if", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "once_cell" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" + +[[package]] +name = "openssl-probe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" + +[[package]] +name = "openssl-src" +version = "111.10.2+1.1.1g" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a287fdb22e32b5b60624d4a5a7a02dbe82777f730ec0dbc42a0554326fef5a70" +dependencies = [ + "cc", +] + +[[package]] +name = "openssl-sys" +version = "0.9.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" +dependencies = [ + "autocfg", + "cc", + "libc", + "openssl-src", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +dependencies = [ + "lock_api", + "parking_lot_core", + "rustc_version", +] + +[[package]] +name = "parking_lot_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +dependencies = [ + "cfg-if", + "cloudabi", + "libc", + "redox_syscall", + "rustc_version", + "smallvec", + "winapi 0.3.9", +] + +[[package]] +name = "pkg-config" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" + +[[package]] +name = "proc-macro2" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" +dependencies = [ + "unicode-xid 0.2.1", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "regex" +version = "1.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", +] + +[[package]] +name = "regex-syntax" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" + +[[package]] +name = "ring" +version = "0.16.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "952cd6b98c85bbc30efa1ba5783b8abf12fec8b3287ffa52605b9432313e34e4" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi 0.3.9", +] + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" +dependencies = [ + "base64", + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +dependencies = [ + "lazy_static", + "winapi 0.3.9", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" + +[[package]] +name = "smallvec" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +dependencies = [ + "maybe-uninit", +] + +[[package]] +name = "socket2" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.9", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "syn" +version = "0.11.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" +dependencies = [ + "quote 0.3.15", + "synom", + "unicode-xid 0.0.4", +] + +[[package]] +name = "syn" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4" +dependencies = [ + "proc-macro2", + "quote 1.0.7", + "unicode-xid 0.2.1", +] + +[[package]] +name = "synom" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" +dependencies = [ + "unicode-xid 0.0.4", +] + +[[package]] +name = "termcolor" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "unicode-xid" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "vcpkg" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +dependencies = [ + "same-file", + "winapi 0.3.9", + "winapi-util", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote 1.0.7", + "syn 1.0.38", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2" +dependencies = [ + "quote 1.0.7", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556" +dependencies = [ + "proc-macro2", + "quote 1.0.7", + "syn 1.0.38", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092" + +[[package]] +name = "web-sys" +version = "0.3.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab146130f5f790d45f82aeeb09e55a256573373ec64409fc19a6fb82fb1032ae" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] diff -Nru rust-curl-0.4.25/Cargo.toml rust-curl-0.4.33/Cargo.toml --- rust-curl-0.4.25/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.33/Cargo.toml 2020-08-19 05:24:59.000000000 +0000 @@ -12,21 +12,27 @@ [package] name = "curl" -version = "0.4.25" +version = "0.4.33" authors = ["Alex Crichton "] autotests = true description = "Rust bindings to libcurl for making HTTP requests" homepage = "https://github.com/alexcrichton/curl-rust" documentation = "https://docs.rs/curl" +readme = "README.md" categories = ["api-bindings", "web-programming::http-client"] license = "MIT" repository = "https://github.com/alexcrichton/curl-rust" +[[example]] +name = "ssl_proxy" +path = "examples/ssl_proxy.rs" +required-features = ["ssl"] + [[test]] name = "atexit" harness = false [dependencies.curl-sys] -version = "0.4.21" +version = "0.4.36" default-features = false [dependencies.libc] @@ -34,6 +40,9 @@ [dependencies.socket2] version = "0.3.7" +[dev-dependencies.anyhow] +version = "1.0.31" + [dev-dependencies.mio] version = "0.6" @@ -45,9 +54,12 @@ force-system-lib-on-osx = ["curl-sys/force-system-lib-on-osx"] http2 = ["curl-sys/http2"] mesalink = ["curl-sys/mesalink"] +protocol-ftp = ["curl-sys/protocol-ftp"] +spnego = ["curl-sys/spnego"] ssl = ["openssl-sys", "openssl-probe", "curl-sys/ssl"] static-curl = ["curl-sys/static-curl"] static-ssl = ["curl-sys/static-ssl"] +zlib-ng-compat = ["curl-sys/zlib-ng-compat", "static-curl"] [target."cfg(all(unix, not(target_os = \"macos\")))".dependencies.openssl-probe] version = "0.1.2" optional = true diff -Nru rust-curl-0.4.25/Cargo.toml.orig rust-curl-0.4.33/Cargo.toml.orig --- rust-curl-0.4.25/Cargo.toml.orig 2019-10-08 18:14:27.000000000 +0000 +++ rust-curl-0.4.33/Cargo.toml.orig 2020-08-19 05:09:05.000000000 +0000 @@ -1,6 +1,6 @@ [package] name = "curl" -version = "0.4.25" +version = "0.4.33" authors = ["Alex Crichton "] license = "MIT" repository = "https://github.com/alexcrichton/curl-rust" @@ -8,6 +8,7 @@ documentation = "https://docs.rs/curl" description = "Rust bindings to libcurl for making HTTP requests" categories = ["api-bindings", "web-programming::http-client"] +readme = "README.md" autotests = true [badges] @@ -16,7 +17,7 @@ [dependencies] libc = "0.2.42" -curl-sys = { path = "curl-sys", version = "0.4.21", default-features = false } +curl-sys = { path = "curl-sys", version = "0.4.36", default-features = false } socket2 = "0.3.7" # Unix platforms use OpenSSL for now to provide SSL functionality @@ -31,6 +32,7 @@ [dev-dependencies] mio = "0.6" mio-extras = "2.0.3" +anyhow = "1.0.31" [workspace] members = ["systest"] @@ -40,10 +42,18 @@ ssl = ["openssl-sys", "openssl-probe", "curl-sys/ssl"] # OpenSSL/system TLS backend mesalink = ["curl-sys/mesalink"] # MesaLink TLS backend http2 = ["curl-sys/http2"] +spnego = ["curl-sys/spnego"] static-curl = ["curl-sys/static-curl"] static-ssl = ["curl-sys/static-ssl"] force-system-lib-on-osx = ['curl-sys/force-system-lib-on-osx'] +protocol-ftp = ["curl-sys/protocol-ftp"] +zlib-ng-compat = ["curl-sys/zlib-ng-compat", "static-curl"] [[test]] name = "atexit" harness = false + +[[example]] +name = "ssl_proxy" +path = "examples/ssl_proxy.rs" +required-features = ["ssl"] diff -Nru rust-curl-0.4.25/.cargo_vcs_info.json rust-curl-0.4.33/.cargo_vcs_info.json --- rust-curl-0.4.25/.cargo_vcs_info.json 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.33/.cargo_vcs_info.json 2020-08-19 05:24:58.000000000 +0000 @@ -1,5 +1,5 @@ { "git": { - "sha1": "cbc96624ebfe6b378ecd7e683b349da43d16264d" + "sha1": "e0f491cb6a1163168cc5ef36b060fde13fa44c1f" } } diff -Nru rust-curl-0.4.25/ci/Dockerfile-linux64-curl rust-curl-0.4.33/ci/Dockerfile-linux64-curl --- rust-curl-0.4.25/ci/Dockerfile-linux64-curl 2016-11-10 15:17:28.000000000 +0000 +++ rust-curl-0.4.33/ci/Dockerfile-linux64-curl 2020-07-18 02:50:13.000000000 +0000 @@ -1,4 +1,4 @@ -FROM ubuntu:14.04 +FROM ubuntu:16.04 RUN apt-get update RUN apt-get install -y --no-install-recommends \ diff -Nru rust-curl-0.4.25/ci/run.sh rust-curl-0.4.33/ci/run.sh --- rust-curl-0.4.25/ci/run.sh 2019-09-06 14:53:37.000000000 +0000 +++ rust-curl-0.4.33/ci/run.sh 2020-07-18 02:50:13.000000000 +0000 @@ -3,12 +3,16 @@ set -ex cargo test --target $TARGET --no-run -cargo test --target $TARGET --no-run --features curl-sys/static-curl +# First test with no extra protocols enabled. +cargo test --target $TARGET --no-run --features static-curl +# Then with all extra protocols enabled. +cargo test --target $TARGET --no-run --features static-curl,protocol-ftp if [ -z "$NO_RUN" ]; then cargo test --target $TARGET - cargo test --target $TARGET --features curl-sys/static-curl + cargo test --target $TARGET --features static-curl + cargo test --target $TARGET --features static-curl,protocol-ftp cargo run --manifest-path systest/Cargo.toml --target $TARGET - cargo run --manifest-path systest/Cargo.toml --target $TARGET --features curl-sys/static-curl + cargo run --manifest-path systest/Cargo.toml --target $TARGET --features curl-sys/static-curl,curl-sys/protocol-ftp cargo doc --no-deps --target $TARGET cargo doc --no-deps -p curl-sys --target $TARGET fi diff -Nru rust-curl-0.4.25/debian/changelog rust-curl-0.4.33/debian/changelog --- rust-curl-0.4.25/debian/changelog 2020-04-14 09:13:55.000000000 +0000 +++ rust-curl-0.4.33/debian/changelog 2020-12-07 05:14:00.000000000 +0000 @@ -1,3 +1,18 @@ +rust-curl (0.4.33-1) unstable; urgency=medium + + * Package curl 0.4.33 from crates.io using debcargo 2.4.3 + * Disable zlib-ng-compat, protocol-ftp and spnego features, the + ftpmasters are currently rejecting new rust feature packages. + * Disable static-with-ftp-disabled test, debian uses + system libcurl even when linking statically and the + system libcurl always has ftp enabled. + + [ Ximin Luo ] + * Team upload. + * Package curl 0.4.33 from crates.io using debcargo 2.4.3 + + -- Peter Michael Green Mon, 07 Dec 2020 05:14:00 +0000 + rust-curl (0.4.25-2) unstable; urgency=medium * Team upload. diff -Nru rust-curl-0.4.25/debian/control rust-curl-0.4.33/debian/control --- rust-curl-0.4.25/debian/control 2020-04-14 09:13:55.000000000 +0000 +++ rust-curl-0.4.33/debian/control 2020-12-07 05:14:00.000000000 +0000 @@ -6,8 +6,8 @@ cargo:native , rustc:native , libstd-rust-dev , - librust-curl-sys-0.4+ssl-dev (>= 0.4.21-~~) , - librust-curl-sys-0.4-dev (>= 0.4.21-~~) , + librust-curl-sys-0.4+ssl-dev (>= 0.4.36-~~) , + librust-curl-sys-0.4-dev (>= 0.4.36-~~) , librust-libc-0.2+default-dev (>= 0.2.42-~~) , librust-openssl-probe-0.1+default-dev (>= 0.1.2-~~) , librust-openssl-sys-0.9+default-dev (>= 0.9.43-~~) , @@ -29,7 +29,7 @@ Multi-Arch: same Depends: ${misc:Depends}, - librust-curl-sys-0.4-dev (>= 0.4.21-~~), + librust-curl-sys-0.4-dev (>= 0.4.36-~~), librust-libc-0.2+default-dev (>= 0.2.42-~~), librust-schannel-0.1+default-dev (>= 0.1.13-~~), librust-socket2-0.3+default-dev (>= 0.3.7-~~), @@ -48,7 +48,7 @@ Provides: librust-curl-0-dev (= ${binary:Version}), librust-curl-0.4-dev (= ${binary:Version}), - librust-curl-0.4.25-dev (= ${binary:Version}) + librust-curl-0.4.33-dev (= ${binary:Version}) Description: Rust bindings to libcurl for making HTTP requests - Rust source code This package contains the source for the Rust curl crate, packaged by debcargo for use with cargo and dh-cargo. @@ -59,11 +59,11 @@ Depends: ${misc:Depends}, librust-curl-dev (= ${binary:Version}), - librust-curl-sys-0.4+force-system-lib-on-osx-dev (>= 0.4.21-~~) + librust-curl-sys-0.4+force-system-lib-on-osx-dev (>= 0.4.36-~~) Provides: librust-curl-0+force-system-lib-on-osx-dev (= ${binary:Version}), librust-curl-0.4+force-system-lib-on-osx-dev (= ${binary:Version}), - librust-curl-0.4.25+force-system-lib-on-osx-dev (= ${binary:Version}) + librust-curl-0.4.33+force-system-lib-on-osx-dev (= ${binary:Version}) Description: Rust bindings to libcurl for making HTTP requests - feature "force-system-lib-on-osx" This metapackage enables feature "force-system-lib-on-osx" for the Rust curl crate, by pulling in any additional dependencies needed by that feature. @@ -74,11 +74,11 @@ Depends: ${misc:Depends}, librust-curl-dev (= ${binary:Version}), - librust-curl-sys-0.4+http2-dev (>= 0.4.21-~~) + librust-curl-sys-0.4+http2-dev (>= 0.4.36-~~) Provides: librust-curl-0+http2-dev (= ${binary:Version}), librust-curl-0.4+http2-dev (= ${binary:Version}), - librust-curl-0.4.25+http2-dev (= ${binary:Version}) + librust-curl-0.4.33+http2-dev (= ${binary:Version}) Description: Rust bindings to libcurl for making HTTP requests - feature "http2" This metapackage enables feature "http2" for the Rust curl crate, by pulling in any additional dependencies needed by that feature. @@ -93,7 +93,7 @@ Provides: librust-curl-0+openssl-probe-dev (= ${binary:Version}), librust-curl-0.4+openssl-probe-dev (= ${binary:Version}), - librust-curl-0.4.25+openssl-probe-dev (= ${binary:Version}) + librust-curl-0.4.33+openssl-probe-dev (= ${binary:Version}) Description: Rust bindings to libcurl for making HTTP requests - feature "openssl-probe" This metapackage enables feature "openssl-probe" for the Rust curl crate, by pulling in any additional dependencies needed by that feature. @@ -108,7 +108,7 @@ Provides: librust-curl-0+openssl-sys-dev (= ${binary:Version}), librust-curl-0.4+openssl-sys-dev (= ${binary:Version}), - librust-curl-0.4.25+openssl-sys-dev (= ${binary:Version}) + librust-curl-0.4.33+openssl-sys-dev (= ${binary:Version}) Description: Rust bindings to libcurl for making HTTP requests - feature "openssl-sys" This metapackage enables feature "openssl-sys" for the Rust curl crate, by pulling in any additional dependencies needed by that feature. @@ -119,7 +119,7 @@ Depends: ${misc:Depends}, librust-curl-dev (= ${binary:Version}), - librust-curl-sys-0.4+ssl-dev (>= 0.4.21-~~), + librust-curl-sys-0.4+ssl-dev (>= 0.4.36-~~), librust-openssl-probe-0.1+default-dev (>= 0.1.2-~~), librust-openssl-sys-0.9+default-dev (>= 0.9.43-~~) Provides: @@ -128,8 +128,8 @@ librust-curl-0+default-dev (= ${binary:Version}), librust-curl-0.4+ssl-dev (= ${binary:Version}), librust-curl-0.4+default-dev (= ${binary:Version}), - librust-curl-0.4.25+ssl-dev (= ${binary:Version}), - librust-curl-0.4.25+default-dev (= ${binary:Version}) + librust-curl-0.4.33+ssl-dev (= ${binary:Version}), + librust-curl-0.4.33+default-dev (= ${binary:Version}) Description: Rust bindings to libcurl for making HTTP requests - feature "ssl" and 1 more This metapackage enables feature "ssl" for the Rust curl crate, by pulling in any additional dependencies needed by that feature. @@ -142,11 +142,11 @@ Depends: ${misc:Depends}, librust-curl-dev (= ${binary:Version}), - librust-curl-sys-0.4+static-curl-dev (>= 0.4.21-~~) + librust-curl-sys-0.4+static-curl-dev (>= 0.4.36-~~) Provides: librust-curl-0+static-curl-dev (= ${binary:Version}), librust-curl-0.4+static-curl-dev (= ${binary:Version}), - librust-curl-0.4.25+static-curl-dev (= ${binary:Version}) + librust-curl-0.4.33+static-curl-dev (= ${binary:Version}) Description: Rust bindings to libcurl for making HTTP requests - feature "static-curl" This metapackage enables feature "static-curl" for the Rust curl crate, by pulling in any additional dependencies needed by that feature. @@ -157,11 +157,11 @@ Depends: ${misc:Depends}, librust-curl-dev (= ${binary:Version}), - librust-curl-sys-0.4+static-ssl-dev (>= 0.4.21-~~) + librust-curl-sys-0.4+static-ssl-dev (>= 0.4.36-~~) Provides: librust-curl-0+static-ssl-dev (= ${binary:Version}), librust-curl-0.4+static-ssl-dev (= ${binary:Version}), - librust-curl-0.4.25+static-ssl-dev (= ${binary:Version}) + librust-curl-0.4.33+static-ssl-dev (= ${binary:Version}) Description: Rust bindings to libcurl for making HTTP requests - feature "static-ssl" This metapackage enables feature "static-ssl" for the Rust curl crate, by pulling in any additional dependencies needed by that feature. diff -Nru rust-curl-0.4.25/debian/patches/disable-features.patch rust-curl-0.4.33/debian/patches/disable-features.patch --- rust-curl-0.4.25/debian/patches/disable-features.patch 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.33/debian/patches/disable-features.patch 2020-12-07 05:14:00.000000000 +0000 @@ -0,0 +1,17 @@ +Index: curl/Cargo.toml +=================================================================== +--- curl.orig/Cargo.toml ++++ curl/Cargo.toml +@@ -53,12 +53,9 @@ version = "2.0.3" + default = ["ssl"] + force-system-lib-on-osx = ["curl-sys/force-system-lib-on-osx"] + http2 = ["curl-sys/http2"] +-protocol-ftp = ["curl-sys/protocol-ftp"] +-spnego = ["curl-sys/spnego"] + ssl = ["openssl-sys", "openssl-probe", "curl-sys/ssl"] + static-curl = ["curl-sys/static-curl"] + static-ssl = ["curl-sys/static-ssl"] +-zlib-ng-compat = ["curl-sys/zlib-ng-compat", "static-curl"] + [target."cfg(all(unix, not(target_os = \"macos\")))".dependencies.openssl-probe] + version = "0.1.2" + optional = true diff -Nru rust-curl-0.4.25/debian/patches/disable-mesalink.patch rust-curl-0.4.33/debian/patches/disable-mesalink.patch --- rust-curl-0.4.25/debian/patches/disable-mesalink.patch 2020-04-14 09:13:55.000000000 +0000 +++ rust-curl-0.4.33/debian/patches/disable-mesalink.patch 2020-12-07 05:14:00.000000000 +0000 @@ -6,6 +6,6 @@ force-system-lib-on-osx = ["curl-sys/force-system-lib-on-osx"] http2 = ["curl-sys/http2"] -mesalink = ["curl-sys/mesalink"] + protocol-ftp = ["curl-sys/protocol-ftp"] + spnego = ["curl-sys/spnego"] ssl = ["openssl-sys", "openssl-probe", "curl-sys/ssl"] - static-curl = ["curl-sys/static-curl"] - static-ssl = ["curl-sys/static-ssl"] diff -Nru rust-curl-0.4.25/debian/patches/disable-static-with-ftp-disabled-test.patch rust-curl-0.4.33/debian/patches/disable-static-with-ftp-disabled-test.patch --- rust-curl-0.4.25/debian/patches/disable-static-with-ftp-disabled-test.patch 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.33/debian/patches/disable-static-with-ftp-disabled-test.patch 2020-12-07 05:14:00.000000000 +0000 @@ -0,0 +1,18 @@ +--- rust-curl-0.4.33/tests/protocols.rs 2020-07-18 02:50:13.000000000 +0000 ++++ curl/tests/protocols.rs 2020-12-07 02:56:44.334196826 +0000 +@@ -1,15 +1,5 @@ + extern crate curl; + +-#[cfg(all(feature = "static-curl", not(feature = "protocol-ftp")))] +-#[test] +-fn static_with_ftp_disabled() { +- assert!(curl::Version::get() +- .protocols() +- .filter(|&p| p == "ftp") +- .next() +- .is_none()); +-} +- + #[cfg(all(feature = "static-curl", feature = "protocol-ftp"))] + #[test] + fn static_with_ftp_enabled() { diff -Nru rust-curl-0.4.25/debian/patches/series rust-curl-0.4.33/debian/patches/series --- rust-curl-0.4.25/debian/patches/series 2020-04-14 09:13:55.000000000 +0000 +++ rust-curl-0.4.33/debian/patches/series 2020-12-07 05:14:00.000000000 +0000 @@ -1 +1,3 @@ disable-mesalink.patch +disable-features.patch +disable-static-with-ftp-disabled-test.patch diff -Nru rust-curl-0.4.25/debian/tests/control rust-curl-0.4.33/debian/tests/control --- rust-curl-0.4.25/debian/tests/control 2020-04-14 09:13:55.000000000 +0000 +++ rust-curl-0.4.33/debian/tests/control 2020-12-07 05:14:00.000000000 +0000 @@ -1,44 +1,44 @@ -Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.25 --all-targets --all-features +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.33 --all-targets --all-features Features: test-name=@ -Depends: dh-cargo (>= 18), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ +Depends: dh-cargo (>= 18), librust-anyhow-1+default-dev (>= 1.0.31-~~), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.25 --all-targets --no-default-features +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.33 --all-targets --no-default-features Features: test-name=librust-curl-dev -Depends: dh-cargo (>= 18), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ +Depends: dh-cargo (>= 18), librust-anyhow-1+default-dev (>= 1.0.31-~~), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.25 --all-targets --features force-system-lib-on-osx +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.33 --all-targets --features force-system-lib-on-osx Features: test-name=librust-curl+force-system-lib-on-osx-dev -Depends: dh-cargo (>= 18), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ +Depends: dh-cargo (>= 18), librust-anyhow-1+default-dev (>= 1.0.31-~~), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.25 --all-targets --features http2 +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.33 --all-targets --features http2 Features: test-name=librust-curl+http2-dev -Depends: dh-cargo (>= 18), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ +Depends: dh-cargo (>= 18), librust-anyhow-1+default-dev (>= 1.0.31-~~), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.25 --all-targets --features openssl-probe +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.33 --all-targets --features openssl-probe Features: test-name=librust-curl+openssl-probe-dev -Depends: dh-cargo (>= 18), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ +Depends: dh-cargo (>= 18), librust-anyhow-1+default-dev (>= 1.0.31-~~), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.25 --all-targets --features openssl-sys +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.33 --all-targets --features openssl-sys Features: test-name=librust-curl+openssl-sys-dev -Depends: dh-cargo (>= 18), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ +Depends: dh-cargo (>= 18), librust-anyhow-1+default-dev (>= 1.0.31-~~), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.25 --all-targets --features ssl +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.33 --all-targets --features ssl Features: test-name=librust-curl+ssl-dev -Depends: dh-cargo (>= 18), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ +Depends: dh-cargo (>= 18), librust-anyhow-1+default-dev (>= 1.0.31-~~), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.25 --all-targets --features static-curl +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.33 --all-targets --features static-curl Features: test-name=librust-curl+static-curl-dev -Depends: dh-cargo (>= 18), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ +Depends: dh-cargo (>= 18), librust-anyhow-1+default-dev (>= 1.0.31-~~), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ Restrictions: allow-stderr, skip-not-installable -Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.25 --all-targets --features static-ssl +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.33 --all-targets --features static-ssl Features: test-name=librust-curl+static-ssl-dev -Depends: dh-cargo (>= 18), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ +Depends: dh-cargo (>= 18), librust-anyhow-1+default-dev (>= 1.0.31-~~), librust-mio-0.6+default-dev, librust-mio-extras-2+default-dev (>= 2.0.3-~~), @ Restrictions: allow-stderr, skip-not-installable diff -Nru rust-curl-0.4.25/examples/ssl_proxy.rs rust-curl-0.4.33/examples/ssl_proxy.rs --- rust-curl-0.4.25/examples/ssl_proxy.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.33/examples/ssl_proxy.rs 2020-07-18 02:50:13.000000000 +0000 @@ -0,0 +1,29 @@ +extern crate anyhow; + +use anyhow::Result; + +fn main() -> Result<()> { + let mut handle = curl::easy::Easy::new(); + + let proxy_url = "https://fwdproxy"; + let proxy_port = 8082; + let cainfo = "/var/credentials/root/ca.pem"; + let sslcert = "/var/credentials/user/x509.pem"; + let sslkey = "/var/credentials/user/x509.pem"; + + handle.connect_timeout(std::time::Duration::from_secs(5))?; + handle.connect_only(true)?; + handle.verbose(true)?; + handle.url("https://www.google.com")?; + + handle.proxy(proxy_url)?; + handle.proxy_port(proxy_port)?; + handle.proxy_cainfo(&cainfo)?; + handle.proxy_sslcert(&sslcert)?; + handle.proxy_sslkey(&sslkey)?; + println!("ssl proxy setup done"); + + handle.perform()?; + println!("connected done"); + Ok(()) +} diff -Nru rust-curl-0.4.25/.github/workflows/main.yml rust-curl-0.4.33/.github/workflows/main.yml --- rust-curl-0.4.25/.github/workflows/main.yml 2019-09-20 16:41:55.000000000 +0000 +++ rust-curl-0.4.33/.github/workflows/main.yml 2020-07-18 02:50:13.000000000 +0000 @@ -1,5 +1,9 @@ name: CI -on: [push, pull_request] +on: + push: + branches: [master] + pull_request: + branches: [master] jobs: test: @@ -67,17 +71,12 @@ rust: stable target: x86_64-pc-windows-msvc steps: - - uses: actions/checkout@master + - uses: actions/checkout@v1 with: submodules: true - name: Install Rust (rustup) run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} - if: matrix.os != 'macos-latest' - - name: Install Rust (macos) - run: | - curl https://sh.rustup.rs | sh -s -- -y --default-toolchain ${{ matrix.rust }} - echo "##[add-path]$HOME/.cargo/bin" - if: matrix.os == 'macos-latest' + shell: bash - run: rustup target add ${{ matrix.target }} - run: TARGET=${{ matrix.target }} ./ci/run.sh if: matrix.os != 'ubuntu-latest' @@ -106,7 +105,7 @@ name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v1 with: submodules: true - name: Install Rust @@ -117,11 +116,15 @@ name: Publish Documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v1 with: submodules: true - name: Install Rust run: rustup update stable && rustup default stable + - name: Install dependencies + run: | + sudo apt update + sudo apt install libkrb5-dev - name: Build documentation run: cargo doc --no-deps --all-features - name: Publish documentation diff -Nru rust-curl-0.4.25/README.md rust-curl-0.4.33/README.md --- rust-curl-0.4.25/README.md 2019-09-06 14:54:42.000000000 +0000 +++ rust-curl-0.4.33/README.md 2020-07-18 02:50:13.000000000 +0000 @@ -1,8 +1,11 @@ # curl-rust -libcurl bindings for Rust +[libcurl] bindings for Rust -[Documentation](https://docs.rs/curl) +[![Latest Version](https://img.shields.io/crates/v/curl.svg)](https://crates.io/crates/curl) +[![Documentation](https://docs.rs/curl/badge.svg)](https://docs.rs/curl) +[![License](https://img.shields.io/github/license/alexcrichton/curl-rust.svg)](LICENSE) +[![Build](https://github.com/alexcrichton/curl-rust/workflows/CI/badge.svg)](https://github.com/alexcrichton/curl-rust/actions) ## Quick Start @@ -145,8 +148,7 @@ That means most likely, that curl was linked against `libcurl-nss.so` due to installed libcurl NSS development files, and that the required library `libnsspem.so` is missing. See also the curl man page: "If curl is built -against the NSS SSL library, the NSS PEM PKCS#11 module (libnsspem.so) needs to -be available for this option to work properly." +against the NSS SSL library, the NSS PEM PKCS#11 module (`libnsspem.so`) needs to be available for this option to work properly." In order to avoid this failure you can either @@ -156,10 +158,12 @@ ## License -The `curl-rust` crate is licensed under the MIT license, see `LICENSE` for more +The `curl-rust` crate is licensed under the MIT license, see [`LICENSE`](LICENSE) for more details. +[libcurl]: https://curl.haxx.se/libcurl/ +[MesaLink]: https://mesalink.io/ [OpenSSL]: https://www.openssl.org/ [Rustls]: https://github.com/ctz/rustls [Schannel]: https://docs.microsoft.com/en-us/windows/win32/com/schannel diff -Nru rust-curl-0.4.25/src/easy/handler.rs rust-curl-0.4.33/src/easy/handler.rs --- rust-curl-0.4.25/src/easy/handler.rs 2019-09-06 14:53:37.000000000 +0000 +++ rust-curl-0.4.33/src/easy/handler.rs 2020-07-23 00:00:26.000000000 +0000 @@ -383,6 +383,7 @@ handle: *mut curl_sys::CURL, header_list: Option, resolve_list: Option, + connect_to_list: Option, form: Option
, error_buf: RefCell>, handler: H, @@ -461,6 +462,17 @@ /// (Added in CURL 7.49.0) V2PriorKnowledge = curl_sys::CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE as isize, + /// Setting this value will make libcurl attempt to use HTTP/3 directly to + /// server given in the URL. Note that this cannot gracefully downgrade to + /// earlier HTTP version if the server doesn't support HTTP/3. + /// + /// For more reliably upgrading to HTTP/3, set the preferred version to + /// something lower and let the server announce its HTTP/3 support via + /// Alt-Svc:. + /// + /// (Added in CURL 7.66.0) + V3 = curl_sys::CURL_HTTP_VERSION_3 as isize, + /// Hidden variant to indicate that this enum should not be matched on, it /// may grow over time. #[doc(hidden)] @@ -614,6 +626,7 @@ handle: handle, header_list: None, resolve_list: None, + connect_to_list: None, form: None, error_buf: RefCell::new(vec![0; curl_sys::CURL_ERROR_SIZE]), handler: handler, @@ -780,18 +793,45 @@ self.setopt_long(curl_sys::CURLOPT_WILDCARDMATCH, m as c_long) } - /// Provides the unix domain socket which this handle will work with. + /// Provides the Unix domain socket which this handle will work with. /// - /// The string provided must be unix domain socket -encoded with the format: + /// The string provided must be a path to a Unix domain socket encoded with + /// the format: /// /// ```text /// /path/file.sock /// ``` + /// + /// By default this option is not set and corresponds to + /// [`CURLOPT_UNIX_SOCKET_PATH`](https://curl.haxx.se/libcurl/c/CURLOPT_UNIX_SOCKET_PATH.html). pub fn unix_socket(&mut self, unix_domain_socket: &str) -> Result<(), Error> { let socket = CString::new(unix_domain_socket)?; self.setopt_str(curl_sys::CURLOPT_UNIX_SOCKET_PATH, &socket) } + /// Provides the Unix domain socket which this handle will work with. + /// + /// The string provided must be a path to a Unix domain socket encoded with + /// the format: + /// + /// ```text + /// /path/file.sock + /// ``` + /// + /// This function is an alternative to [`Easy2::unix_socket`] that supports + /// non-UTF-8 paths and also supports disabling Unix sockets by setting the + /// option to `None`. + /// + /// By default this option is not set and corresponds to + /// [`CURLOPT_UNIX_SOCKET_PATH`](https://curl.haxx.se/libcurl/c/CURLOPT_UNIX_SOCKET_PATH.html). + pub fn unix_socket_path>(&mut self, path: Option

) -> Result<(), Error> { + if let Some(path) = path { + self.setopt_path(curl_sys::CURLOPT_UNIX_SOCKET_PATH, path.as_ref()) + } else { + self.setopt_ptr(curl_sys::CURLOPT_UNIX_SOCKET_PATH, 0 as _) + } + } + // ========================================================================= // Internal accessors @@ -847,6 +887,24 @@ self.setopt_long(curl_sys::CURLOPT_PORT, port as c_long) } + /// Connect to a specific host and port. + /// + /// Each single string should be written using the format + /// `HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT` where `HOST` is the host of + /// the request, `PORT` is the port of the request, `CONNECT-TO-HOST` is the + /// host name to connect to, and `CONNECT-TO-PORT` is the port to connect + /// to. + /// + /// The first string that matches the request's host and port is used. + /// + /// By default, this option is empty and corresponds to + /// [`CURLOPT_CONNECT_TO`](https://curl.haxx.se/libcurl/c/CURLOPT_CONNECT_TO.html). + pub fn connect_to(&mut self, list: List) -> Result<(), Error> { + let ptr = list::raw(&list); + self.inner.connect_to_list = Some(list); + self.setopt_ptr(curl_sys::CURLOPT_CONNECT_TO, ptr as *const _) + } + // /// Indicates whether sequences of `/../` and `/./` will be squashed or not. // /// // /// By default this option is `false` and corresponds to @@ -870,6 +928,46 @@ self.setopt_long(curl_sys::CURLOPT_PROXYPORT, port as c_long) } + /// Set CA certificate to verify peer against for proxy. + /// + /// By default this value is not set and corresponds to + /// `CURLOPT_PROXY_CAINFO`. + pub fn proxy_cainfo(&mut self, cainfo: &str) -> Result<(), Error> { + let cainfo = CString::new(cainfo)?; + self.setopt_str(curl_sys::CURLOPT_PROXY_CAINFO, &cainfo) + } + + /// Specify a directory holding CA certificates for proxy. + /// + /// The specified directory should hold multiple CA certificates to verify + /// the HTTPS proxy with. If libcurl is built against OpenSSL, the + /// certificate directory must be prepared using the OpenSSL `c_rehash` + /// utility. + /// + /// By default this value is not set and corresponds to + /// `CURLOPT_PROXY_CAPATH`. + pub fn proxy_capath>(&mut self, path: P) -> Result<(), Error> { + self.setopt_path(curl_sys::CURLOPT_PROXY_CAPATH, path.as_ref()) + } + + /// Set client certificate for proxy. + /// + /// By default this value is not set and corresponds to + /// `CURLOPT_PROXY_SSLCERT`. + pub fn proxy_sslcert(&mut self, sslcert: &str) -> Result<(), Error> { + let sslcert = CString::new(sslcert)?; + self.setopt_str(curl_sys::CURLOPT_PROXY_SSLCERT, &sslcert) + } + + /// Set private key for HTTPS proxy. + /// + /// By default this value is not set and corresponds to + /// `CURLOPT_PROXY_SSLKEY`. + pub fn proxy_sslkey(&mut self, sslkey: &str) -> Result<(), Error> { + let sslkey = CString::new(sslkey)?; + self.setopt_str(curl_sys::CURLOPT_PROXY_SSLKEY, &sslkey) + } + /// Indicates the type of proxy being used. /// /// By default this option is `ProxyType::Http` and corresponds to diff -Nru rust-curl-0.4.25/src/easy/handle.rs rust-curl-0.4.33/src/easy/handle.rs --- rust-curl-0.4.25/src/easy/handle.rs 2019-09-06 14:53:37.000000000 +0000 +++ rust-curl-0.4.33/src/easy/handle.rs 2020-07-23 00:00:26.000000000 +0000 @@ -165,6 +165,11 @@ self.inner.unix_socket(unix_domain_socket) } + /// Same as [`Easy2::unix_socket_path`](struct.Easy2.html#method.unix_socket_path) + pub fn unix_socket_path>(&mut self, path: Option

) -> Result<(), Error> { + self.inner.unix_socket_path(path) + } + // ========================================================================= // Callback options @@ -553,6 +558,11 @@ self.inner.port(port) } + /// Same as [`Easy2::connect_to`](struct.Easy2.html#method.connect_to) + pub fn connect_to(&mut self, list: List) -> Result<(), Error> { + self.inner.connect_to(list) + } + /// Same as [`Easy2::proxy`](struct.Easy2.html#method.proxy) pub fn proxy(&mut self, url: &str) -> Result<(), Error> { self.inner.proxy(url) @@ -563,6 +573,26 @@ self.inner.proxy_port(port) } + /// Same as [`Easy2::proxy_cainfo`](struct.Easy2.html#method.proxy_cainfo) + pub fn proxy_cainfo(&mut self, cainfo: &str) -> Result<(), Error> { + self.inner.proxy_cainfo(cainfo) + } + + /// Same as [`Easy2::proxy_capath`](struct.Easy2.html#method.proxy_capath) + pub fn proxy_capath>(&mut self, path: P) -> Result<(), Error> { + self.inner.proxy_capath(path) + } + + /// Same as [`Easy2::proxy_sslcert`](struct.Easy2.html#method.proxy_sslcert) + pub fn proxy_sslcert(&mut self, sslcert: &str) -> Result<(), Error> { + self.inner.proxy_sslcert(sslcert) + } + + /// Same as [`Easy2::proxy_sslkey`](struct.Easy2.html#method.proxy_sslkey) + pub fn proxy_sslkey(&mut self, sslkey: &str) -> Result<(), Error> { + self.inner.proxy_sslkey(sslkey) + } + /// Same as [`Easy2::proxy_type`](struct.Easy2.html#method.proxy_type) pub fn proxy_type(&mut self, kind: ProxyType) -> Result<(), Error> { self.inner.proxy_type(kind) diff -Nru rust-curl-0.4.25/src/error.rs rust-curl-0.4.33/src/error.rs --- rust-curl-0.4.25/src/error.rs 2019-04-25 14:42:06.000000000 +0000 +++ rust-curl-0.4.33/src/error.rs 2020-07-18 02:50:13.000000000 +0000 @@ -303,6 +303,16 @@ self.code } + /// Returns the general description of this error code, using curl's + /// builtin `strerror`-like functionality. + pub fn description(&self) -> &str { + unsafe { + let s = curl_sys::curl_easy_strerror(self.code); + assert!(!s.is_null()); + str::from_utf8(CStr::from_ptr(s).to_bytes()).unwrap() + } + } + /// Returns the extra description of this error, if any is available. pub fn extra_description(&self) -> Option<&str> { self.extra.as_ref().map(|s| &**s) @@ -311,7 +321,7 @@ impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - let desc = error::Error::description(self); + let desc = self.description(); match self.extra { Some(ref s) => write!(f, "[{}] {} ({})", self.code(), desc, s), None => write!(f, "[{}] {}", self.code(), desc), @@ -322,22 +332,14 @@ impl fmt::Debug for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Error") - .field("description", &error::Error::description(self)) + .field("description", &self.description()) .field("code", &self.code) .field("extra", &self.extra) .finish() } } -impl error::Error for Error { - fn description(&self) -> &str { - unsafe { - let s = curl_sys::curl_easy_strerror(self.code); - assert!(!s.is_null()); - str::from_utf8(CStr::from_ptr(s).to_bytes()).unwrap() - } - } -} +impl error::Error for Error {} /// An error returned from "share" operations. /// @@ -382,11 +384,20 @@ pub fn code(&self) -> curl_sys::CURLSHcode { self.code } + + /// Returns curl's human-readable version of this error. + pub fn description(&self) -> &str { + unsafe { + let s = curl_sys::curl_share_strerror(self.code); + assert!(!s.is_null()); + str::from_utf8(CStr::from_ptr(s).to_bytes()).unwrap() + } + } } impl fmt::Display for ShareError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - error::Error::description(self).fmt(f) + self.description().fmt(f) } } @@ -395,21 +406,13 @@ write!( f, "ShareError {{ description: {:?}, code: {} }}", - error::Error::description(self), + self.description(), self.code ) } } -impl error::Error for ShareError { - fn description(&self) -> &str { - unsafe { - let s = curl_sys::curl_share_strerror(self.code); - assert!(!s.is_null()); - str::from_utf8(CStr::from_ptr(s).to_bytes()).unwrap() - } - } -} +impl error::Error for ShareError {} /// An error from "multi" operations. /// @@ -469,34 +472,33 @@ pub fn code(&self) -> curl_sys::CURLMcode { self.code } + + /// Returns curl's human-readable description of this error. + pub fn description(&self) -> &str { + unsafe { + let s = curl_sys::curl_multi_strerror(self.code); + assert!(!s.is_null()); + str::from_utf8(CStr::from_ptr(s).to_bytes()).unwrap() + } + } } impl fmt::Display for MultiError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - error::Error::description(self).fmt(f) + self.description().fmt(f) } } impl fmt::Debug for MultiError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!( - f, - "MultiError {{ description: {:?}, code: {} }}", - error::Error::description(self), - self.code - ) + f.debug_struct("MultiError") + .field("description", &self.description()) + .field("code", &self.code) + .finish() } } -impl error::Error for MultiError { - fn description(&self) -> &str { - unsafe { - let s = curl_sys::curl_multi_strerror(self.code); - assert!(!s.is_null()); - str::from_utf8(CStr::from_ptr(s).to_bytes()).unwrap() - } - } -} +impl error::Error for MultiError {} /// An error from "form add" operations. /// @@ -551,27 +553,9 @@ pub fn code(&self) -> curl_sys::CURLFORMcode { self.code } -} - -impl fmt::Display for FormError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - error::Error::description(self).fmt(f) - } -} - -impl fmt::Debug for FormError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!( - f, - "FormError {{ description: {:?}, code: {} }}", - error::Error::description(self), - self.code - ) - } -} -impl error::Error for FormError { - fn description(&self) -> &str { + /// Returns a human-readable description of this error code. + pub fn description(&self) -> &str { match self.code { curl_sys::CURL_FORMADD_MEMORY => "allocation failure", curl_sys::CURL_FORMADD_OPTION_TWICE => "one option passed twice", @@ -587,6 +571,23 @@ } } +impl fmt::Display for FormError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.description().fmt(f) + } +} + +impl fmt::Debug for FormError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("FormError") + .field("description", &self.description()) + .field("code", &self.code) + .finish() + } +} + +impl error::Error for FormError {} + impl From for Error { fn from(_: ffi::NulError) -> Error { Error { diff -Nru rust-curl-0.4.25/src/lib.rs rust-curl-0.4.33/src/lib.rs --- rust-curl-0.4.25/src/lib.rs 2019-08-28 14:11:34.000000000 +0000 +++ rust-curl-0.4.33/src/lib.rs 2020-07-18 02:50:13.000000000 +0000 @@ -46,6 +46,12 @@ //! There is a large number of releases for libcurl, all with different sets of //! capabilities. Robust programs may wish to inspect `Version::get()` to test //! what features are implemented in the linked build of libcurl at runtime. +//! +//! # Initialization +//! +//! The underlying libcurl library must be initialized before use and has +//! certain requirements on how this is done. Check the documentation for +//! [`init`] for more details. #![deny(missing_docs, missing_debug_implementations)] #![doc(html_root_url = "https://docs.rs/curl/0.4")] @@ -78,34 +84,63 @@ /// Initializes the underlying libcurl library. /// -/// It's not required to call this before the library is used, but it's -/// recommended to do so as soon as the program starts. +/// The underlying libcurl library must be initialized before use, and must be +/// done so on the main thread before any other threads are created by the +/// program. This crate will do this for you automatically in the following +/// scenarios: +/// +/// - Creating a new [`Easy`][easy::Easy] or [`Multi`][multi::Multi] handle +/// - At program startup on Windows, macOS, Linux, Android, or FreeBSD systems +/// +/// This should be sufficient for most applications and scenarios, but in any +/// other case, it is strongly recommended that you call this function manually +/// as soon as your program starts. +/// +/// Calling this function more than once is harmless and has no effect. +#[inline] pub fn init() { + /// Used to prevent concurrent or duplicate initialization. static INIT: Once = Once::new(); - INIT.call_once(|| { - platform_init(); - unsafe { - assert_eq!(curl_sys::curl_global_init(curl_sys::CURL_GLOBAL_ALL), 0); - } - - // Note that we explicitly don't schedule a call to - // `curl_global_cleanup`. The documentation for that function says - // - // > You must not call it when any other thread in the program (i.e. a - // > thread sharing the same memory) is running. This doesn't just mean - // > no other thread that is using libcurl. - // - // We can't ever be sure of that, so unfortunately we can't call the - // function. - }); - - #[cfg(need_openssl_init)] - fn platform_init() { - openssl_sys::init(); + + /// An exported constructor function. On supported platforms, this will be + /// invoked automatically before the program's `main` is called. + #[cfg_attr( + any(target_os = "linux", target_os = "freebsd", target_os = "android"), + link_section = ".init_array" + )] + #[cfg_attr(target_os = "macos", link_section = "__DATA,__mod_init_func")] + #[cfg_attr(target_os = "windows", link_section = ".CRT$XCU")] + static INIT_CTOR: extern "C" fn() = init_inner; + + /// This is the body of our constructor function. + #[cfg_attr( + any(target_os = "linux", target_os = "android"), + link_section = ".text.startup" + )] + extern "C" fn init_inner() { + INIT.call_once(|| { + #[cfg(need_openssl_init)] + openssl_sys::init(); + + unsafe { + assert_eq!(curl_sys::curl_global_init(curl_sys::CURL_GLOBAL_ALL), 0); + } + + // Note that we explicitly don't schedule a call to + // `curl_global_cleanup`. The documentation for that function says + // + // > You must not call it when any other thread in the program (i.e. + // > a thread sharing the same memory) is running. This doesn't just + // > mean no other thread that is using libcurl. + // + // We can't ever be sure of that, so unfortunately we can't call the + // function. + }); } - #[cfg(not(need_openssl_init))] - fn platform_init() {} + // We invoke our init function through our static to ensure the symbol isn't + // optimized away by a bug: https://github.com/rust-lang/rust/issues/47384 + INIT_CTOR(); } unsafe fn opt_str<'a>(ptr: *const libc::c_char) -> Option<&'a str> { diff -Nru rust-curl-0.4.25/src/multi.rs rust-curl-0.4.33/src/multi.rs --- rust-curl-0.4.25/src/multi.rs 2019-10-01 19:56:56.000000000 +0000 +++ rust-curl-0.4.33/src/multi.rs 2020-07-18 02:50:13.000000000 +0000 @@ -696,19 +696,28 @@ } } - /// Attempt to close the multi handle and clean up all associated resources. + /// Does nothing and returns `Ok(())`. This method remains for backwards + /// compatibility. /// - /// Cleans up and removes a whole multi stack. It does not free or touch any - /// individual easy handles in any way - they still need to be closed - /// individually. + /// This method will be changed to take `self` in a future release. + #[doc(hidden)] + #[deprecated( + since = "0.4.30", + note = "cannot close safely without consuming self; \ + will be changed or removed in a future release" + )] pub fn close(&self) -> Result<(), MultiError> { - unsafe { cvt(curl_sys::curl_multi_cleanup(self.raw)) } + Ok(()) } /// Get a pointer to the raw underlying CURLM handle. pub fn raw(&self) -> *mut curl_sys::CURLM { self.raw } + + unsafe fn close_impl(&self) -> Result<(), MultiError> { + cvt(curl_sys::curl_multi_cleanup(self.raw)) + } } fn cvt(code: curl_sys::CURLMcode) -> Result<(), MultiError> { @@ -727,7 +736,7 @@ impl Drop for Multi { fn drop(&mut self) { - let _ = self.close(); + let _ = unsafe { self.close_impl() }; } } diff -Nru rust-curl-0.4.25/src/version.rs rust-curl-0.4.33/src/version.rs --- rust-curl-0.4.25/src/version.rs 2019-10-08 18:14:27.000000000 +0000 +++ rust-curl-0.4.33/src/version.rs 2020-07-18 02:50:13.000000000 +0000 @@ -141,6 +141,16 @@ self.flag(curl_sys::CURL_VERSION_HTTP2) } + /// Returns whether libcurl was built with support for HTTP3. + pub fn feature_http3(&self) -> bool { + self.flag(curl_sys::CURL_VERSION_HTTP3) + } + + /// Returns whether libcurl was built with support for Brotli. + pub fn feature_brotli(&self) -> bool { + self.flag(curl_sys::CURL_VERSION_BROTLI) + } + fn flag(&self, flag: c_int) -> bool { unsafe { (*self.inner).features & flag != 0 } } @@ -276,6 +286,28 @@ } else { None } + } + } + + /// If available, the built-in default of CURLOPT_CAINFO. + pub fn cainfo(&self) -> Option<&str> { + unsafe { + if (*self.inner).age >= curl_sys::CURLVERSION_SEVENTH { + ::opt_str((*self.inner).cainfo) + } else { + None + } + } + } + + /// If available, the built-in default of CURLOPT_CAPATH. + pub fn capath(&self) -> Option<&str> { + unsafe { + if (*self.inner).age >= curl_sys::CURLVERSION_SEVENTH { + ::opt_str((*self.inner).capath) + } else { + None + } } } } diff -Nru rust-curl-0.4.25/tests/easy.rs rust-curl-0.4.33/tests/easy.rs --- rust-curl-0.4.25/tests/easy.rs 2019-08-26 14:07:12.000000000 +0000 +++ rust-curl-0.4.33/tests/easy.rs 2020-07-18 02:50:13.000000000 +0000 @@ -801,9 +801,30 @@ t!(h.borrow().perform()); } -// Stupid test to check if unix_socket is callable +#[cfg(not(windows))] #[test] fn check_unix_socket() { + let s = Server::new_unix(); + s.receive( + "\ + POST / HTTP/1.1\r\n\ + Host: localhost\r\n\ + Accept: */*\r\n\ + Content-Length: 5\r\n\ + Content-Type: application/x-www-form-urlencoded\r\n\ + \r\n\ + data\n", + ); + s.send( + "\ + HTTP/1.1 200 OK\r\n\ + \r\n", + ); + let mut h = handle(); - drop(h.unix_socket("/var/something.socks")); + t!(h.unix_socket(s.path())); + t!(h.url(&s.url("/"))); + t!(h.post(true)); + t!(h.post_fields_copy(b"data\n")); + t!(h.perform()); } diff -Nru rust-curl-0.4.25/tests/protocols.rs rust-curl-0.4.33/tests/protocols.rs --- rust-curl-0.4.25/tests/protocols.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.33/tests/protocols.rs 2020-07-18 02:50:13.000000000 +0000 @@ -0,0 +1,21 @@ +extern crate curl; + +#[cfg(all(feature = "static-curl", not(feature = "protocol-ftp")))] +#[test] +fn static_with_ftp_disabled() { + assert!(curl::Version::get() + .protocols() + .filter(|&p| p == "ftp") + .next() + .is_none()); +} + +#[cfg(all(feature = "static-curl", feature = "protocol-ftp"))] +#[test] +fn static_with_ftp_enabled() { + assert!(curl::Version::get() + .protocols() + .filter(|&p| p == "ftp") + .next() + .is_some()); +} diff -Nru rust-curl-0.4.25/tests/server/mod.rs rust-curl-0.4.33/tests/server/mod.rs --- rust-curl-0.4.25/tests/server/mod.rs 2019-04-04 14:15:08.000000000 +0000 +++ rust-curl-0.4.33/tests/server/mod.rs 2020-07-18 02:50:13.000000000 +0000 @@ -4,12 +4,13 @@ use std::io::prelude::*; use std::io::BufReader; use std::net::{SocketAddr, TcpListener, TcpStream}; +use std::path::PathBuf; use std::sync::mpsc::{channel, Receiver, Sender}; use std::thread; pub struct Server { messages: Option>, - addr: SocketAddr, + addr: Addr, thread: Option>, } @@ -18,8 +19,13 @@ Write(String), } -fn run(listener: &TcpListener, rx: &Receiver) { - let mut socket = BufReader::new(listener.accept().unwrap().0); +enum Addr { + Tcp(SocketAddr), + Unix(PathBuf), +} + +fn run(stream: impl Read + Write, rx: &Receiver) { + let mut socket = BufReader::new(stream); for msg in rx.iter() { match msg { Message::Read(ref expected) => { @@ -110,7 +116,7 @@ let mut dst = Vec::new(); t!(socket.read_to_end(&mut dst)); - assert!(dst.len() == 0); + assert_eq!(dst.len(), 0); } fn lines_match(expected: &str, mut actual: &str) -> bool { @@ -133,22 +139,43 @@ let listener = t!(TcpListener::bind("127.0.0.1:0")); let addr = t!(listener.local_addr()); let (tx, rx) = channel(); - let thread = thread::spawn(move || run(&listener, &rx)); + let thread = thread::spawn(move || run(listener.accept().unwrap().0, &rx)); + Server { + messages: Some(tx), + addr: Addr::Tcp(addr), + thread: Some(thread), + } + } + + #[cfg(not(windows))] + pub fn new_unix() -> Server { + use std::os::unix::net::UnixListener; + + let path = "/tmp/easy_server.sock"; + std::fs::remove_file(path).ok(); + let listener = t!(UnixListener::bind(path)); + let (tx, rx) = channel(); + let thread = thread::spawn(move || run(listener.incoming().next().unwrap().unwrap(), &rx)); Server { messages: Some(tx), - addr: addr, + addr: Addr::Unix(path.into()), thread: Some(thread), } } pub fn receive(&self, msg: &str) { - let msg = msg.replace("$PORT", &self.addr.port().to_string()); - self.msg(Message::Read(msg)); + self.msg(Message::Read(self.replace_port(msg))); + } + + fn replace_port(&self, msg: &str) -> String { + match &self.addr { + Addr::Tcp(addr) => msg.replace("$PORT", &addr.port().to_string()), + Addr::Unix(_) => msg.to_string(), + } } pub fn send(&self, msg: &str) { - let msg = msg.replace("$PORT", &self.addr.port().to_string()); - self.msg(Message::Write(msg)); + self.msg(Message::Write(self.replace_port(msg))); } fn msg(&self, msg: Message) { @@ -156,17 +183,35 @@ } pub fn addr(&self) -> &SocketAddr { - &self.addr + match &self.addr { + Addr::Tcp(addr) => addr, + Addr::Unix(_) => panic!("server is a UnixListener"), + } + } + + #[cfg(not(windows))] + pub fn path(&self) -> &str { + match &self.addr { + Addr::Tcp(_) => panic!("server is a TcpListener"), + Addr::Unix(p) => p.as_os_str().to_str().unwrap(), + } } pub fn url(&self, path: &str) -> String { - format!("http://{}{}", self.addr, path) + match &self.addr { + Addr::Tcp(addr) => format!("http://{}{}", addr, path), + Addr::Unix(_) => format!("http://localhost{}", path), + } } } impl Drop for Server { fn drop(&mut self) { - drop(TcpStream::connect(&self.addr)); + match &self.addr { + Addr::Tcp(addr) => drop(TcpStream::connect(addr)), + Addr::Unix(p) => t!(std::fs::remove_file(p)), + } + drop(self.messages.take()); let res = self.thread.take().unwrap().join(); if !thread::panicking() {