diff -Nru rust-curl-0.4.33/Cargo.lock rust-curl-0.4.39/Cargo.lock --- rust-curl-0.4.33/Cargo.lock 2020-08-19 05:24:59.000000000 +0000 +++ rust-curl-0.4.39/Cargo.lock 1970-01-01 00:00:01.000000000 +0000 @@ -1,19 +1,21 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "aho-corasick" -version = "0.7.13" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" dependencies = [ "memchr", ] [[package]] name = "anyhow" -version = "1.0.32" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b" +checksum = "2c0df63cb2955042487fad3aefd2c6e3ae7389ac5dc1beb28921de0b69f779d4" [[package]] name = "atty" @@ -28,9 +30,9 @@ [[package]] name = "autocfg" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "base64" @@ -61,9 +63,9 @@ [[package]] name = "cc" -version = "1.0.59" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66120af515773fb005778dc07c261bd201ec8ce50bd6e7144c927753fe013381" +checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" [[package]] name = "cfg-if" @@ -72,6 +74,12 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] name = "cloudabi" version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -82,16 +90,16 @@ [[package]] name = "cmake" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e56268c17a6248366d66d4a47a3381369d068cce8409bb1716ed77ea32163bb" +checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" dependencies = [ "cc", ] [[package]] name = "curl" -version = "0.4.33" +version = "0.4.39" dependencies = [ "anyhow", "curl-sys", @@ -107,9 +115,9 @@ [[package]] name = "curl-sys" -version = "0.4.36+curl-7.71.1" +version = "0.4.49+curl-7.79.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cad94adeb0c16558429c3c34a607acc9ea58e09a7b66310aabc9788fc5d721" +checksum = "e0f44960aea24a786a46907b8824ebc0e66ca06bf4e4978408c7499620343483" dependencies = [ "cc", "libc", @@ -163,9 +171,9 @@ [[package]] name = "hermit-abi" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" +checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" dependencies = [ "libc", ] @@ -190,9 +198,9 @@ [[package]] name = "js-sys" -version = "0.3.44" +version = "0.3.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85a7e2c92a4804dd459b86c339278d0fe87cf93757fae222c3fa3ae75458bc73" +checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175" dependencies = [ "wasm-bindgen", ] @@ -221,15 +229,15 @@ [[package]] name = "libc" -version = "0.2.74" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" +checksum = "56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714" [[package]] name = "libnghttp2-sys" -version = "0.1.4+1.41.0" +version = "0.1.6+1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1" +checksum = "0af55541a8827e138d59ec9e5877fb6095ece63fb6f4da45e7491b4fbd262855" dependencies = [ "cc", "libc", @@ -237,9 +245,9 @@ [[package]] name = "libz-sys" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af67924b8dd885cccea261866c8ce5b74d239d272e154053ff927dae839f5ae9" +checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" dependencies = [ "cc", "cmake", @@ -263,7 +271,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -274,9 +282,9 @@ [[package]] name = "memchr" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "mesalink" @@ -302,11 +310,11 @@ [[package]] name = "mio" -version = "0.6.22" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "fuchsia-zircon", "fuchsia-zircon-sys", "iovec", @@ -333,9 +341,9 @@ [[package]] name = "miow" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" dependencies = [ "kernel32-sys", "net2", @@ -345,20 +353,20 @@ [[package]] name = "net2" -version = "0.2.34" +version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +checksum = "d7cf75f38f16cb05ea017784dc6dbfd354f76c223dba37701734c4f5a9337d02" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "winapi 0.3.9", ] [[package]] name = "once_cell" -version = "1.4.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" +checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" [[package]] name = "openssl-probe" @@ -368,9 +376,9 @@ [[package]] name = "openssl-src" -version = "111.10.2+1.1.1g" +version = "111.12.0+1.1.1h" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a287fdb22e32b5b60624d4a5a7a02dbe82777f730ec0dbc42a0554326fef5a70" +checksum = "858a4132194f8570a7ee9eb8629e85b23cbc4565f2d4a162e87556e5956abf61" dependencies = [ "cc", ] @@ -406,7 +414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi", "libc", "redox_syscall", @@ -417,15 +425,15 @@ [[package]] name = "pkg-config" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "proc-macro2" -version = "1.0.19" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ "unicode-xid 0.2.1", ] @@ -459,9 +467,9 @@ [[package]] name = "regex" -version = "1.3.9" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" dependencies = [ "aho-corasick", "memchr", @@ -471,15 +479,15 @@ [[package]] name = "regex-syntax" -version = "0.6.18" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" +checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" [[package]] name = "ring" -version = "0.16.15" +version = "0.16.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "952cd6b98c85bbc30efa1ba5783b8abf12fec8b3287ffa52605b9432313e34e4" +checksum = "024a1e66fea74c66c66624ee5622a7ff0e4b73a13b4f5c326ddb50c708944226" dependencies = [ "cc", "libc", @@ -579,13 +587,11 @@ [[package]] name = "socket2" -version = "0.3.12" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" +checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" dependencies = [ - "cfg-if", "libc", - "redox_syscall", "winapi 0.3.9", ] @@ -608,9 +614,9 @@ [[package]] name = "syn" -version = "1.0.38" +version = "1.0.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4" +checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44" dependencies = [ "proc-macro2", "quote 1.0.7", @@ -628,9 +634,9 @@ [[package]] name = "termcolor" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" dependencies = [ "winapi-util", ] @@ -681,34 +687,34 @@ [[package]] name = "wasm-bindgen" -version = "0.2.67" +version = "0.2.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0563a9a4b071746dd5aedbc3a28c6fe9be4586fb3fbadb67c400d4f53c6b16c" +checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.67" +version = "0.2.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc71e4c5efa60fb9e74160e89b93353bc24059999c0ae0fb03affc39770310b0" +checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62" dependencies = [ "bumpalo", "lazy_static", "log", "proc-macro2", "quote 1.0.7", - "syn 1.0.38", + "syn 1.0.54", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.67" +version = "0.2.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97c57cefa5fa80e2ba15641578b44d36e7a64279bc5ed43c6dbaf329457a2ed2" +checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084" dependencies = [ "quote 1.0.7", "wasm-bindgen-macro-support", @@ -716,28 +722,28 @@ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.67" +version = "0.2.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841a6d1c35c6f596ccea1f82504a192a60378f64b3bb0261904ad8f2f5657556" +checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549" dependencies = [ "proc-macro2", "quote 1.0.7", - "syn 1.0.38", + "syn 1.0.54", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.67" +version = "0.2.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b162580e34310e5931c4b792560108b10fd14d64915d7fff8ff00180e70092" +checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158" [[package]] name = "web-sys" -version = "0.3.44" +version = "0.3.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda38f4e5ca63eda02c059d243aa25b5f35ab98451e518c51612cd0f1bd19a47" +checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3" dependencies = [ "js-sys", "wasm-bindgen", @@ -745,9 +751,9 @@ [[package]] name = "webpki" -version = "0.21.3" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab146130f5f790d45f82aeeb09e55a256573373ec64409fc19a6fb82fb1032ae" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" dependencies = [ "ring", "untrusted", diff -Nru rust-curl-0.4.33/Cargo.toml rust-curl-0.4.39/Cargo.toml --- rust-curl-0.4.33/Cargo.toml 2020-08-19 05:24:59.000000000 +0000 +++ rust-curl-0.4.39/Cargo.toml 1970-01-01 00:00:01.000000000 +0000 @@ -3,16 +3,16 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] +edition = "2018" name = "curl" -version = "0.4.33" +version = "0.4.39" authors = ["Alex Crichton "] autotests = true description = "Rust bindings to libcurl for making HTTP requests" @@ -28,18 +28,28 @@ path = "examples/ssl_proxy.rs" required-features = ["ssl"] +[[example]] +name = "ssl_cert_blob" +path = "examples/ssl_cert_blob.rs" +required-features = ["ssl"] + +[[example]] +name = "aws_sigv4" +path = "examples/aws_sigv4.rs" +required-features = ["static-curl", "ssl"] + [[test]] name = "atexit" harness = false [dependencies.curl-sys] -version = "0.4.36" +version = "0.4.49" default-features = false [dependencies.libc] version = "0.2.42" [dependencies.socket2] -version = "0.3.7" +version = "0.4.0" [dev-dependencies.anyhow] version = "1.0.31" @@ -59,6 +69,7 @@ ssl = ["openssl-sys", "openssl-probe", "curl-sys/ssl"] static-curl = ["curl-sys/static-curl"] static-ssl = ["curl-sys/static-ssl"] +upkeep_7_62_0 = ["curl-sys/upkeep_7_62_0"] 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" diff -Nru rust-curl-0.4.33/Cargo.toml.orig rust-curl-0.4.39/Cargo.toml.orig --- rust-curl-0.4.33/Cargo.toml.orig 2020-08-19 05:09:05.000000000 +0000 +++ rust-curl-0.4.39/Cargo.toml.orig 1973-11-29 21:33:09.000000000 +0000 @@ -1,6 +1,6 @@ [package] name = "curl" -version = "0.4.33" +version = "0.4.39" authors = ["Alex Crichton "] license = "MIT" repository = "https://github.com/alexcrichton/curl-rust" @@ -10,6 +10,7 @@ categories = ["api-bindings", "web-programming::http-client"] readme = "README.md" autotests = true +edition = "2018" [badges] travis-ci = { repository = "alexcrichton/curl-rust" } @@ -17,8 +18,8 @@ [dependencies] libc = "0.2.42" -curl-sys = { path = "curl-sys", version = "0.4.36", default-features = false } -socket2 = "0.3.7" +curl-sys = { path = "curl-sys", version = "0.4.49", default-features = false } +socket2 = "0.4.0" # Unix platforms use OpenSSL for now to provide SSL functionality [target.'cfg(all(unix, not(target_os = "macos")))'.dependencies] @@ -48,6 +49,7 @@ 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"] +upkeep_7_62_0 = ["curl-sys/upkeep_7_62_0"] [[test]] name = "atexit" @@ -57,3 +59,13 @@ name = "ssl_proxy" path = "examples/ssl_proxy.rs" required-features = ["ssl"] + +[[example]] +name = "ssl_cert_blob" +path = "examples/ssl_cert_blob.rs" +required-features = ["ssl"] + +[[example]] +name = "aws_sigv4" +path = "examples/aws_sigv4.rs" +required-features = ["static-curl", "ssl"] diff -Nru rust-curl-0.4.33/.cargo_vcs_info.json rust-curl-0.4.39/.cargo_vcs_info.json --- rust-curl-0.4.33/.cargo_vcs_info.json 2020-08-19 05:24:58.000000000 +0000 +++ rust-curl-0.4.39/.cargo_vcs_info.json 1970-01-01 00:00:01.000000000 +0000 @@ -1,5 +1,5 @@ { "git": { - "sha1": "e0f491cb6a1163168cc5ef36b060fde13fa44c1f" + "sha1": "b57ef183bbeef5b6d6bc0539d6f6eecd3f24115f" } } diff -Nru rust-curl-0.4.33/ci/run.sh rust-curl-0.4.39/ci/run.sh --- rust-curl-0.4.33/ci/run.sh 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/ci/run.sh 1973-11-29 21:33:09.000000000 +0000 @@ -11,8 +11,14 @@ cargo test --target $TARGET cargo test --target $TARGET --features static-curl cargo test --target $TARGET --features static-curl,protocol-ftp + + # Note that `-Clink-dead-code` is passed here to suppress `--gc-sections` to + # help confirm that we're compiling everything necessary for curl itself. + RUSTFLAGS=-Clink-dead-code \ cargo run --manifest-path systest/Cargo.toml --target $TARGET + RUSTFLAGS=-Clink-dead-code \ 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.33/debian/changelog rust-curl-0.4.39/debian/changelog --- rust-curl-0.4.33/debian/changelog 2020-12-07 05:14:00.000000000 +0000 +++ rust-curl-0.4.39/debian/changelog 2021-10-23 18:03:08.000000000 +0000 @@ -1,3 +1,10 @@ +rust-curl (0.4.39-1) unstable; urgency=medium + + * Team upload. + * Package curl 0.4.39 from crates.io using debcargo 2.4.4 + + -- Ximin Luo Sat, 23 Oct 2021 19:03:08 +0100 + rust-curl (0.4.33-1) unstable; urgency=medium * Package curl 0.4.33 from crates.io using debcargo 2.4.3 diff -Nru rust-curl-0.4.33/debian/compat rust-curl-0.4.39/debian/compat --- rust-curl-0.4.33/debian/compat 2020-12-07 05:14:00.000000000 +0000 +++ rust-curl-0.4.39/debian/compat 2021-10-23 18:03:08.000000000 +0000 @@ -1 +1 @@ -11 +12 diff -Nru rust-curl-0.4.33/debian/control rust-curl-0.4.39/debian/control --- rust-curl-0.4.33/debian/control 2020-12-07 05:14:00.000000000 +0000 +++ rust-curl-0.4.39/debian/control 2021-10-23 18:03:08.000000000 +0000 @@ -1,38 +1,39 @@ Source: rust-curl Section: rust Priority: optional -Build-Depends: debhelper (>= 11), - dh-cargo (>= 18), +Build-Depends: debhelper (>= 12), + dh-cargo (>= 24), cargo:native , rustc:native , libstd-rust-dev , - librust-curl-sys-0.4+ssl-dev (>= 0.4.36-~~) , - librust-curl-sys-0.4-dev (>= 0.4.36-~~) , + librust-curl-sys-0.4+ssl-dev (>= 0.4.49-~~) , + librust-curl-sys-0.4-dev (>= 0.4.49-~~) , 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-~~) , librust-schannel-0.1+default-dev (>= 0.1.13-~~) , - librust-socket2-0.3+default-dev (>= 0.3.7-~~) , + librust-socket2-0.4+default-dev , librust-winapi-0.3+default-dev , librust-winapi-0.3+libloaderapi-dev , librust-winapi-0.3+wincrypt-dev Maintainer: Debian Rust Maintainers Uploaders: kpcyrd -Standards-Version: 4.4.1 +Standards-Version: 4.5.1 Vcs-Git: https://salsa.debian.org/rust-team/debcargo-conf.git [src/curl] Vcs-Browser: https://salsa.debian.org/rust-team/debcargo-conf/tree/master/src/curl Homepage: https://github.com/alexcrichton/curl-rust +Rules-Requires-Root: no Package: librust-curl-dev Architecture: any Multi-Arch: same Depends: ${misc:Depends}, - librust-curl-sys-0.4-dev (>= 0.4.36-~~), + librust-curl-sys-0.4-dev (>= 0.4.49-~~), 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-~~), + librust-socket2-0.4+default-dev, librust-winapi-0.3+default-dev, librust-winapi-0.3+libloaderapi-dev, librust-winapi-0.3+wincrypt-dev @@ -48,7 +49,7 @@ Provides: librust-curl-0-dev (= ${binary:Version}), librust-curl-0.4-dev (= ${binary:Version}), - librust-curl-0.4.33-dev (= ${binary:Version}) + librust-curl-0.4.39-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 +60,11 @@ Depends: ${misc:Depends}, librust-curl-dev (= ${binary:Version}), - librust-curl-sys-0.4+force-system-lib-on-osx-dev (>= 0.4.36-~~) + librust-curl-sys-0.4+force-system-lib-on-osx-dev (>= 0.4.49-~~) 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.33+force-system-lib-on-osx-dev (= ${binary:Version}) + librust-curl-0.4.39+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 +75,11 @@ Depends: ${misc:Depends}, librust-curl-dev (= ${binary:Version}), - librust-curl-sys-0.4+http2-dev (>= 0.4.36-~~) + librust-curl-sys-0.4+http2-dev (>= 0.4.49-~~) Provides: librust-curl-0+http2-dev (= ${binary:Version}), librust-curl-0.4+http2-dev (= ${binary:Version}), - librust-curl-0.4.33+http2-dev (= ${binary:Version}) + librust-curl-0.4.39+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 +94,7 @@ Provides: librust-curl-0+openssl-probe-dev (= ${binary:Version}), librust-curl-0.4+openssl-probe-dev (= ${binary:Version}), - librust-curl-0.4.33+openssl-probe-dev (= ${binary:Version}) + librust-curl-0.4.39+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 +109,7 @@ Provides: librust-curl-0+openssl-sys-dev (= ${binary:Version}), librust-curl-0.4+openssl-sys-dev (= ${binary:Version}), - librust-curl-0.4.33+openssl-sys-dev (= ${binary:Version}) + librust-curl-0.4.39+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 +120,7 @@ Depends: ${misc:Depends}, librust-curl-dev (= ${binary:Version}), - librust-curl-sys-0.4+ssl-dev (>= 0.4.36-~~), + librust-curl-sys-0.4+ssl-dev (>= 0.4.49-~~), librust-openssl-probe-0.1+default-dev (>= 0.1.2-~~), librust-openssl-sys-0.9+default-dev (>= 0.9.43-~~) Provides: @@ -128,8 +129,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.33+ssl-dev (= ${binary:Version}), - librust-curl-0.4.33+default-dev (= ${binary:Version}) + librust-curl-0.4.39+ssl-dev (= ${binary:Version}), + librust-curl-0.4.39+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 +143,11 @@ Depends: ${misc:Depends}, librust-curl-dev (= ${binary:Version}), - librust-curl-sys-0.4+static-curl-dev (>= 0.4.36-~~) + librust-curl-sys-0.4+static-curl-dev (>= 0.4.49-~~) Provides: librust-curl-0+static-curl-dev (= ${binary:Version}), librust-curl-0.4+static-curl-dev (= ${binary:Version}), - librust-curl-0.4.33+static-curl-dev (= ${binary:Version}) + librust-curl-0.4.39+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 +158,11 @@ Depends: ${misc:Depends}, librust-curl-dev (= ${binary:Version}), - librust-curl-sys-0.4+static-ssl-dev (>= 0.4.36-~~) + librust-curl-sys-0.4+static-ssl-dev (>= 0.4.49-~~) Provides: librust-curl-0+static-ssl-dev (= ${binary:Version}), librust-curl-0.4+static-ssl-dev (= ${binary:Version}), - librust-curl-0.4.33+static-ssl-dev (= ${binary:Version}) + librust-curl-0.4.39+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.33/debian/copyright rust-curl-0.4.39/debian/copyright --- rust-curl-0.4.33/debian/copyright 2020-12-07 05:14:00.000000000 +0000 +++ rust-curl-0.4.39/debian/copyright 2021-10-23 18:03:08.000000000 +0000 @@ -11,7 +11,7 @@ Files: debian/* Copyright: - 2018-2020 Debian Rust Maintainers + 2018-2021 Debian Rust Maintainers 2018 kpcyrd License: MIT diff -Nru rust-curl-0.4.33/debian/copyright.debcargo.hint rust-curl-0.4.39/debian/copyright.debcargo.hint --- rust-curl-0.4.33/debian/copyright.debcargo.hint 2020-12-07 05:14:00.000000000 +0000 +++ rust-curl-0.4.39/debian/copyright.debcargo.hint 2021-10-23 18:03:08.000000000 +0000 @@ -21,8 +21,8 @@ Files: debian/* Copyright: - 2018-2020 Debian Rust Maintainers - 2018-2020 kpcyrd + 2018-2021 Debian Rust Maintainers + 2018-2021 kpcyrd License: MIT License: MIT diff -Nru rust-curl-0.4.33/debian/librust-curl+force-system-lib-on-osx-dev.lintian-overrides rust-curl-0.4.39/debian/librust-curl+force-system-lib-on-osx-dev.lintian-overrides --- rust-curl-0.4.33/debian/librust-curl+force-system-lib-on-osx-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.39/debian/librust-curl+force-system-lib-on-osx-dev.lintian-overrides 2021-10-23 18:03:08.000000000 +0000 @@ -0,0 +1 @@ +librust-curl+force-system-lib-on-osx-dev binary: empty-rust-library-declares-provides * \ No newline at end of file diff -Nru rust-curl-0.4.33/debian/librust-curl+http2-dev.lintian-overrides rust-curl-0.4.39/debian/librust-curl+http2-dev.lintian-overrides --- rust-curl-0.4.33/debian/librust-curl+http2-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.39/debian/librust-curl+http2-dev.lintian-overrides 2021-10-23 18:03:08.000000000 +0000 @@ -0,0 +1 @@ +librust-curl+http2-dev binary: empty-rust-library-declares-provides * \ No newline at end of file diff -Nru rust-curl-0.4.33/debian/librust-curl+openssl-probe-dev.lintian-overrides rust-curl-0.4.39/debian/librust-curl+openssl-probe-dev.lintian-overrides --- rust-curl-0.4.33/debian/librust-curl+openssl-probe-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.39/debian/librust-curl+openssl-probe-dev.lintian-overrides 2021-10-23 18:03:08.000000000 +0000 @@ -0,0 +1 @@ +librust-curl+openssl-probe-dev binary: empty-rust-library-declares-provides * \ No newline at end of file diff -Nru rust-curl-0.4.33/debian/librust-curl+openssl-sys-dev.lintian-overrides rust-curl-0.4.39/debian/librust-curl+openssl-sys-dev.lintian-overrides --- rust-curl-0.4.33/debian/librust-curl+openssl-sys-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.39/debian/librust-curl+openssl-sys-dev.lintian-overrides 2021-10-23 18:03:08.000000000 +0000 @@ -0,0 +1 @@ +librust-curl+openssl-sys-dev binary: empty-rust-library-declares-provides * \ No newline at end of file diff -Nru rust-curl-0.4.33/debian/librust-curl+ssl-dev.lintian-overrides rust-curl-0.4.39/debian/librust-curl+ssl-dev.lintian-overrides --- rust-curl-0.4.33/debian/librust-curl+ssl-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.39/debian/librust-curl+ssl-dev.lintian-overrides 2021-10-23 18:03:08.000000000 +0000 @@ -0,0 +1 @@ +librust-curl+ssl-dev binary: empty-rust-library-declares-provides * \ No newline at end of file diff -Nru rust-curl-0.4.33/debian/librust-curl+static-curl-dev.lintian-overrides rust-curl-0.4.39/debian/librust-curl+static-curl-dev.lintian-overrides --- rust-curl-0.4.33/debian/librust-curl+static-curl-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.39/debian/librust-curl+static-curl-dev.lintian-overrides 2021-10-23 18:03:08.000000000 +0000 @@ -0,0 +1 @@ +librust-curl+static-curl-dev binary: empty-rust-library-declares-provides * \ No newline at end of file diff -Nru rust-curl-0.4.33/debian/librust-curl+static-ssl-dev.lintian-overrides rust-curl-0.4.39/debian/librust-curl+static-ssl-dev.lintian-overrides --- rust-curl-0.4.33/debian/librust-curl+static-ssl-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.39/debian/librust-curl+static-ssl-dev.lintian-overrides 2021-10-23 18:03:08.000000000 +0000 @@ -0,0 +1 @@ +librust-curl+static-ssl-dev binary: empty-rust-library-declares-provides * \ No newline at end of file diff -Nru rust-curl-0.4.33/debian/patches/disable-features.patch rust-curl-0.4.39/debian/patches/disable-features.patch --- rust-curl-0.4.33/debian/patches/disable-features.patch 2020-12-07 05:14:00.000000000 +0000 +++ rust-curl-0.4.39/debian/patches/disable-features.patch 2021-10-23 18:03:08.000000000 +0000 @@ -1,8 +1,8 @@ -Index: curl/Cargo.toml -=================================================================== ---- curl.orig/Cargo.toml -+++ curl/Cargo.toml -@@ -53,12 +53,9 @@ version = "2.0.3" +Description: for now, disable some features to avoid NEW trip + +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -63,13 +63,9 @@ default = ["ssl"] force-system-lib-on-osx = ["curl-sys/force-system-lib-on-osx"] http2 = ["curl-sys/http2"] @@ -11,6 +11,7 @@ ssl = ["openssl-sys", "openssl-probe", "curl-sys/ssl"] static-curl = ["curl-sys/static-curl"] static-ssl = ["curl-sys/static-ssl"] +-upkeep_7_62_0 = ["curl-sys/upkeep_7_62_0"] -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" diff -Nru rust-curl-0.4.33/debian/patches/disable-static-with-ftp-disabled-test.patch rust-curl-0.4.39/debian/patches/disable-static-with-ftp-disabled-test.patch --- rust-curl-0.4.33/debian/patches/disable-static-with-ftp-disabled-test.patch 2020-12-07 05:14:00.000000000 +0000 +++ rust-curl-0.4.39/debian/patches/disable-static-with-ftp-disabled-test.patch 2021-10-23 18:03:08.000000000 +0000 @@ -1,8 +1,6 @@ --- 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; - +@@ -1,13 +1,3 @@ -#[cfg(all(feature = "static-curl", not(feature = "protocol-ftp")))] -#[test] -fn static_with_ftp_disabled() { diff -Nru rust-curl-0.4.33/debian/tests/control rust-curl-0.4.39/debian/tests/control --- rust-curl-0.4.33/debian/tests/control 2020-12-07 05:14:00.000000000 +0000 +++ rust-curl-0.4.39/debian/tests/control 2021-10-23 18:03:08.000000000 +0000 @@ -1,44 +1,49 @@ -Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.33 --all-targets --all-features -Features: test-name=@ +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.39 --all-targets --all-features +Features: test-name=rust-curl:@ 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.33 --all-targets --no-default-features -Features: test-name=librust-curl-dev +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.39 --all-targets --no-default-features +Features: test-name=librust-curl-dev: 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.33 --all-targets --features force-system-lib-on-osx -Features: test-name=librust-curl+force-system-lib-on-osx-dev +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.39 --all-targets --no-default-features --features force-system-lib-on-osx +Features: test-name=librust-curl+force-system-lib-on-osx-dev:force-system-lib-on-osx 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.33 --all-targets --features http2 -Features: test-name=librust-curl+http2-dev +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.39 --all-targets --no-default-features --features http2 +Features: test-name=librust-curl+http2-dev:http2 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.33 --all-targets --features openssl-probe -Features: test-name=librust-curl+openssl-probe-dev +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.39 --all-targets --no-default-features --features openssl-probe +Features: test-name=librust-curl+openssl-probe-dev:openssl-probe 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.33 --all-targets --features openssl-sys -Features: test-name=librust-curl+openssl-sys-dev +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.39 --all-targets --no-default-features --features openssl-sys +Features: test-name=librust-curl+openssl-sys-dev:openssl-sys 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.33 --all-targets --features ssl -Features: test-name=librust-curl+ssl-dev +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.39 --all-targets +Features: test-name=librust-curl+ssl-dev:default 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.33 --all-targets --features static-curl -Features: test-name=librust-curl+static-curl-dev +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.39 --all-targets --no-default-features --features ssl +Features: test-name=librust-curl+ssl-dev:ssl 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.33 --all-targets --features static-ssl -Features: test-name=librust-curl+static-ssl-dev +Test-Command: /usr/share/cargo/bin/cargo-auto-test curl 0.4.39 --all-targets --no-default-features --features static-curl +Features: test-name=librust-curl+static-curl-dev:static-curl +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.39 --all-targets --no-default-features --features static-ssl +Features: test-name=librust-curl+static-ssl-dev:static-ssl 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.33/examples/aws_sigv4.rs rust-curl-0.4.39/examples/aws_sigv4.rs --- rust-curl-0.4.33/examples/aws_sigv4.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.39/examples/aws_sigv4.rs 1973-11-29 21:33:09.000000000 +0000 @@ -0,0 +1,14 @@ +use anyhow::Result; + +use curl::easy::Easy; + +fn main() -> Result<()> { + let mut handle = Easy::new(); + handle.verbose(true)?; + handle.url("https://ec2.us-east-1.amazonaws.com/?Action=DescribeRegions&Version=2013-10-15")?; + handle.aws_sigv4("aws:amz")?; + handle.username("myAccessKeyId")?; + handle.password("mySecretAccessKey")?; + handle.perform()?; + Ok(()) +} diff -Nru rust-curl-0.4.33/examples/ssl_cert_blob.rs rust-curl-0.4.39/examples/ssl_cert_blob.rs --- rust-curl-0.4.33/examples/ssl_cert_blob.rs 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.39/examples/ssl_cert_blob.rs 1973-11-29 21:33:09.000000000 +0000 @@ -0,0 +1,42 @@ +use std::env; +use std::fs::File; +use std::io::{stdout, Read, Write}; +use std::path::Path; + +use anyhow::{bail, Result}; +use curl::easy::Easy; + +fn read_file(path: impl AsRef) -> Result> { + let mut f = File::open(path)?; + let mut buf = Vec::new(); + f.read_to_end(&mut buf)?; + Ok(buf) +} + +fn main() -> Result<()> { + let argv = env::args().collect::>(); + if argv.len() < 4 { + bail!("usage: ssl_cert_blob URL CERT KEY"); + } + let url = &argv[1]; + let cert_path = &argv[2]; + let key_path = &argv[3]; + + let mut handle = Easy::new(); + + handle.url(url)?; + handle.verbose(true)?; + handle.write_function(|data| { + stdout().write_all(data).unwrap(); + Ok(data.len()) + })?; + + let cert_blob = read_file(cert_path)?; + let key_blob = read_file(key_path)?; + + handle.ssl_cert_blob(&cert_blob)?; + handle.ssl_key_blob(&key_blob)?; + + handle.perform()?; + Ok(()) +} diff -Nru rust-curl-0.4.33/examples/ssl_proxy.rs rust-curl-0.4.39/examples/ssl_proxy.rs --- rust-curl-0.4.33/examples/ssl_proxy.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/examples/ssl_proxy.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,5 +1,3 @@ -extern crate anyhow; - use anyhow::Result; fn main() -> Result<()> { diff -Nru rust-curl-0.4.33/.github/dependabot.yml rust-curl-0.4.39/.github/dependabot.yml --- rust-curl-0.4.33/.github/dependabot.yml 1970-01-01 00:00:00.000000000 +0000 +++ rust-curl-0.4.39/.github/dependabot.yml 1973-11-29 21:33:09.000000000 +0000 @@ -0,0 +1,8 @@ +version: 2 +updates: +- package-ecosystem: cargo + directory: "/" + schedule: + interval: daily + time: "08:00" + open-pull-requests-limit: 10 diff -Nru rust-curl-0.4.33/.gitignore rust-curl-0.4.39/.gitignore --- rust-curl-0.4.33/.gitignore 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/.gitignore 1973-11-29 21:33:09.000000000 +0000 @@ -1,2 +1,3 @@ Cargo.lock target/ +.idea/ diff -Nru rust-curl-0.4.33/README.md rust-curl-0.4.39/README.md --- rust-curl-0.4.33/README.md 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/README.md 1973-11-29 21:33:09.000000000 +0000 @@ -128,6 +128,7 @@ - `static-curl`: Use a bundled libcurl version and statically link to it. Disabled by default. - `static-ssl`: Use a bundled OpenSSL version and statically link to it. Only applies on platforms that use OpenSSL. Disabled by default. - `spnego`: Enable SPNEGO support. Disabled by default. +- `upkeep_7_62_0`: Enable curl_easy_upkeep() support, introduced in curl 7.62.0. Disabled by default. ## Version Support diff -Nru rust-curl-0.4.33/src/easy/form.rs rust-curl-0.4.39/src/easy/form.rs --- rust-curl-0.4.33/src/easy/form.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/src/easy/form.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,10 +1,11 @@ use std::ffi::CString; use std::fmt; use std::path::Path; +use std::ptr; +use crate::easy::{list, List}; +use crate::FormError; use curl_sys; -use easy::{list, List}; -use FormError; /// Multipart/formdata for an HTTP POST request. /// @@ -34,8 +35,8 @@ /// Creates a new blank form ready for the addition of new data. pub fn new() -> Form { Form { - head: 0 as *mut _, - tail: 0 as *mut _, + head: ptr::null_mut(), + tail: ptr::null_mut(), headers: Vec::new(), buffers: Vec::new(), strings: Vec::new(), @@ -50,10 +51,10 @@ Part { error: None, form: self, - name: name, + name, array: vec![curl_sys::curl_forms { option: curl_sys::CURLFORM_END, - value: 0 as *mut _, + value: ptr::null_mut(), }], } } diff -Nru rust-curl-0.4.33/src/easy/handler.rs rust-curl-0.4.39/src/easy/handler.rs --- rust-curl-0.4.33/src/easy/handler.rs 2020-07-23 00:00:26.000000000 +0000 +++ rust-curl-0.4.39/src/easy/handler.rs 1973-11-29 21:33:09.000000000 +0000 @@ -3,6 +3,7 @@ use std::fmt; use std::io::{self, SeekFrom, Write}; use std::path::Path; +use std::ptr; use std::slice; use std::str; use std::time::Duration; @@ -11,12 +12,12 @@ use libc::{self, c_char, c_double, c_int, c_long, c_ulong, c_void, size_t}; use socket2::Socket; -use easy::form; -use easy::list; -use easy::windows; -use easy::{Form, List}; -use panic; -use Error; +use crate::easy::form; +use crate::easy::list; +use crate::easy::windows; +use crate::easy::{Form, List}; +use crate::panic; +use crate::Error; /// A trait for the various callbacks used by libcurl to invoke user code. /// @@ -306,13 +307,12 @@ InfoType::HeaderOut => ">", InfoType::DataIn | InfoType::SslDataIn => "{", InfoType::DataOut | InfoType::SslDataOut => "}", - InfoType::__Nonexhaustive => " ", }; let mut out = out.lock(); drop(write!(out, "{} ", prefix)); match str::from_utf8(data) { Ok(s) => drop(out.write_all(s.as_bytes())), - Err(_) => drop(write!(out, "({} bytes of data)\n", data.len())), + Err(_) => drop(writeln!(out, "({} bytes of data)", data.len())), } } @@ -392,6 +392,7 @@ unsafe impl Send for Inner {} /// Possible proxy types that libcurl currently understands. +#[non_exhaustive] #[allow(missing_docs)] #[derive(Debug, Clone, Copy)] pub enum ProxyType { @@ -401,14 +402,10 @@ Socks5 = curl_sys::CURLPROXY_SOCKS5 as isize, Socks4a = curl_sys::CURLPROXY_SOCKS4A as isize, Socks5Hostname = curl_sys::CURLPROXY_SOCKS5_HOSTNAME as isize, - - /// Hidden variant to indicate that this enum should not be matched on, it - /// may grow over time. - #[doc(hidden)] - __Nonexhaustive, } /// Possible conditions for the `time_condition` method. +#[non_exhaustive] #[allow(missing_docs)] #[derive(Debug, Clone, Copy)] pub enum TimeCondition { @@ -416,28 +413,20 @@ IfModifiedSince = curl_sys::CURL_TIMECOND_IFMODSINCE as isize, IfUnmodifiedSince = curl_sys::CURL_TIMECOND_IFUNMODSINCE as isize, LastModified = curl_sys::CURL_TIMECOND_LASTMOD as isize, - - /// Hidden variant to indicate that this enum should not be matched on, it - /// may grow over time. - #[doc(hidden)] - __Nonexhaustive, } /// Possible values to pass to the `ip_resolve` method. +#[non_exhaustive] #[allow(missing_docs)] #[derive(Debug, Clone, Copy)] pub enum IpResolve { V4 = curl_sys::CURL_IPRESOLVE_V4 as isize, V6 = curl_sys::CURL_IPRESOLVE_V6 as isize, Any = curl_sys::CURL_IPRESOLVE_WHATEVER as isize, - - /// Hidden variant to indicate that this enum should not be matched on, it - /// may grow over time. - #[doc(hidden)] - __Nonexhaustive = 500, } /// Possible values to pass to the `http_version` method. +#[non_exhaustive] #[derive(Debug, Clone, Copy)] pub enum HttpVersion { /// We don't care what http version to use, and we'd like the library to @@ -472,14 +461,10 @@ /// /// (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)] - __Nonexhaustive = 500, } /// Possible values to pass to the `ssl_version` and `ssl_min_max_version` method. +#[non_exhaustive] #[allow(missing_docs)] #[derive(Debug, Clone, Copy)] pub enum SslVersion { @@ -491,14 +476,10 @@ Tlsv11 = curl_sys::CURL_SSLVERSION_TLSv1_1 as isize, Tlsv12 = curl_sys::CURL_SSLVERSION_TLSv1_2 as isize, Tlsv13 = curl_sys::CURL_SSLVERSION_TLSv1_3 as isize, - - /// Hidden variant to indicate that this enum should not be matched on, it - /// may grow over time. - #[doc(hidden)] - __Nonexhaustive = 500, } /// Possible return values from the `seek_function` callback. +#[non_exhaustive] #[derive(Debug, Clone, Copy)] pub enum SeekResult { /// Indicates that the seek operation was a success @@ -511,15 +492,11 @@ /// Indicates that although the seek failed libcurl should attempt to keep /// working if possible (for example "seek" through reading). CantSeek = curl_sys::CURL_SEEKFUNC_CANTSEEK as isize, - - /// Hidden variant to indicate that this enum should not be matched on, it - /// may grow over time. - #[doc(hidden)] - __Nonexhaustive = 500, } /// Possible data chunks that can be witnessed as part of the `debug_function` /// callback. +#[non_exhaustive] #[derive(Debug, Clone, Copy)] pub enum InfoType { /// The data is informational text. @@ -542,14 +519,10 @@ /// The data is SSL/TLS (binary) data sent to the peer. SslDataOut, - - /// Hidden variant to indicate that this enum should not be matched on, it - /// may grow over time. - #[doc(hidden)] - __Nonexhaustive, } /// Possible error codes that can be returned from the `read_function` callback. +#[non_exhaustive] #[derive(Debug)] pub enum ReadError { /// Indicates that the connection should be aborted immediately @@ -557,23 +530,14 @@ /// Indicates that reading should be paused until `unpause` is called. Pause, - - /// Hidden variant to indicate that this enum should not be matched on, it - /// may grow over time. - #[doc(hidden)] - __Nonexhaustive, } /// Possible error codes that can be returned from the `write_function` callback. +#[non_exhaustive] #[derive(Debug)] pub enum WriteError { /// Indicates that reading should be paused until `unpause` is called. Pause, - - /// Hidden variant to indicate that this enum should not be matched on, it - /// may grow over time. - #[doc(hidden)] - __Nonexhaustive, } /// Options for `.netrc` parsing. @@ -617,23 +581,23 @@ /// `perform` and need to be reset manually (or via the `reset` method) if /// this is not desired. pub fn new(handler: H) -> Easy2 { - ::init(); + crate::init(); unsafe { let handle = curl_sys::curl_easy_init(); assert!(!handle.is_null()); let mut ret = Easy2 { inner: Box::new(Inner { - handle: 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, + handler, }), }; ret.default_configure(); - return ret; + ret } } @@ -709,7 +673,18 @@ #[cfg(need_openssl_probe)] fn ssl_configure(&mut self) { - let probe = ::openssl_probe::probe(); + use std::sync::Once; + + static mut PROBE: Option<::openssl_probe::ProbeResult> = None; + static INIT: Once = Once::new(); + + // Probe for certificate stores the first time an easy handle is created, + // and re-use the results for subsequent handles. + INIT.call_once(|| unsafe { + PROBE = Some(::openssl_probe::probe()); + }); + let probe = unsafe { PROBE.as_ref().unwrap() }; + if let Some(ref path) = probe.cert_file { let _ = self.cainfo(path); } @@ -905,12 +880,13 @@ 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 - // /// `CURLOPT_PATH_AS_IS`. - // pub fn path_as_is(&mut self, as_is: bool) -> Result<(), Error> { - // } + /// Indicates whether sequences of `/../` and `/./` will be squashed or not. + /// + /// By default this option is `false` and corresponds to + /// `CURLOPT_PATH_AS_IS`. + pub fn path_as_is(&mut self, as_is: bool) -> Result<(), Error> { + self.setopt_long(curl_sys::CURLOPT_PATH_AS_IS, as_is as c_long) + } /// Provide the URL of a proxy to use. /// @@ -959,6 +935,17 @@ self.setopt_str(curl_sys::CURLOPT_PROXY_SSLCERT, &sslcert) } + /// Set the client certificate for the proxy using an in-memory blob. + /// + /// The specified byte buffer should contain the binary content of the + /// certificate, which will be copied into the handle. + /// + /// By default this option is not set and corresponds to + /// `CURLOPT_PROXY_SSLCERT_BLOB`. + pub fn proxy_sslcert_blob(&mut self, blob: &[u8]) -> Result<(), Error> { + self.setopt_blob(curl_sys::CURLOPT_PROXY_SSLCERT_BLOB, blob) + } + /// Set private key for HTTPS proxy. /// /// By default this value is not set and corresponds to @@ -968,6 +955,17 @@ self.setopt_str(curl_sys::CURLOPT_PROXY_SSLKEY, &sslkey) } + /// Set the pricate key for the proxy using an in-memory blob. + /// + /// The specified byte buffer should contain the binary content of the + /// private key, which will be copied into the handle. + /// + /// By default this option is not set and corresponds to + /// `CURLOPT_PROXY_SSLKEY_BLOB`. + pub fn proxy_sslkey_blob(&mut self, blob: &[u8]) -> Result<(), Error> { + self.setopt_blob(curl_sys::CURLOPT_PROXY_SSLKEY_BLOB, blob) + } + /// Indicates the type of proxy being used. /// /// By default this option is `ProxyType::Http` and corresponds to @@ -1063,6 +1061,17 @@ self.setopt_long(curl_sys::CURLOPT_BUFFERSIZE, size as c_long) } + /// Specify the preferred send buffer size, in bytes. + /// + /// This is treated as a request, not an order, and the main point of this + /// is that the read callback may get called more often with smaller + /// chunks. + /// + /// The upload buffer size is by default 64 kilobytes. + pub fn upload_buffer_size(&mut self, size: usize) -> Result<(), Error> { + self.setopt_long(curl_sys::CURLOPT_UPLOAD_BUFFERSIZE, size as c_long) + } + // /// Enable or disable TCP Fast Open // /// // /// By default this options defaults to `false` and corresponds to @@ -1155,6 +1164,33 @@ self.setopt_long(curl_sys::CURLOPT_HTTPAUTH, auth.bits) } + /// Provides AWS V4 signature authentication on HTTP(S) header. + /// + /// `param` is used to create outgoing authentication headers. + /// Its format is `provider1[:provider2[:region[:service]]]`. + /// `provider1,\ provider2"` are used for generating auth parameters + /// such as "Algorithm", "date", "request type" and "signed headers". + /// `region` is the geographic area of a resources collection. It is + /// extracted from the host name specified in the URL if omitted. + /// `service` is a function provided by a cloud. It is extracted + /// from the host name specified in the URL if omitted. + /// + /// Example with "Test:Try", when curl will do the algorithm, it will + /// generate "TEST-HMAC-SHA256" for "Algorithm", "x-try-date" and + /// "X-Try-Date" for "date", "test4_request" for "request type", and + /// "SignedHeaders=content-type;host;x-try-date" for "signed headers". + /// If you use just "test", instead of "test:try", test will be use + /// for every strings generated. + /// + /// This is a special auth type that can't be combined with the others. + /// It will override the other auth types you might have set. + /// + /// By default this is not set and corresponds to `CURLOPT_AWS_SIGV4`. + pub fn aws_sigv4(&mut self, param: &str) -> Result<(), Error> { + let param = CString::new(param)?; + self.setopt_str(curl_sys::CURLOPT_AWS_SIGV4, ¶m) + } + /// Configures the proxy username to pass as authentication for this /// connection. /// @@ -1777,6 +1813,17 @@ self.setopt_long(curl_sys::CURLOPT_MAXCONNECTS, max as c_long) } + /// Set the maximum idle time allowed for a connection. + /// + /// This configuration sets the maximum time that a connection inside of the connection cache + /// can be reused. Any connection older than this value will be considered stale and will + /// be closed. + /// + /// By default, a value of 118 seconds is used. + pub fn maxage_conn(&mut self, max_age: Duration) -> Result<(), Error> { + self.setopt_long(curl_sys::CURLOPT_MAXAGE_CONN, max_age.as_secs() as c_long) + } + /// Force a new connection to be used. /// /// Makes the next transfer use a new (fresh) connection by force instead of @@ -1943,6 +1990,18 @@ self.setopt_path(curl_sys::CURLOPT_SSLCERT, cert.as_ref()) } + /// Set the SSL client certificate using an in-memory blob. + /// + /// The specified byte buffer should contain the binary content of your + /// client certificate, which will be copied into the handle. The format of + /// the certificate can be specified with `ssl_cert_type`. + /// + /// By default this option is not set and corresponds to + /// `CURLOPT_SSLCERT_BLOB`. + pub fn ssl_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error> { + self.setopt_blob(curl_sys::CURLOPT_SSLCERT_BLOB, blob) + } + /// Specify type of the client SSL certificate. /// /// The string should be the format of your certificate. Supported formats @@ -1971,6 +2030,18 @@ self.setopt_path(curl_sys::CURLOPT_SSLKEY, key.as_ref()) } + /// Specify an SSL private key using an in-memory blob. + /// + /// The specified byte buffer should contain the binary content of your + /// private key, which will be copied into the handle. The format of + /// the private key can be specified with `ssl_key_type`. + /// + /// By default this option is not set and corresponds to + /// `CURLOPT_SSLKEY_BLOB`. + pub fn ssl_key_blob(&mut self, blob: &[u8]) -> Result<(), Error> { + self.setopt_blob(curl_sys::CURLOPT_SSLKEY_BLOB, blob) + } + /// Set type of the private key file. /// /// The string should be the format of your private key. Supported formats @@ -2135,6 +2206,18 @@ self.setopt_path(curl_sys::CURLOPT_ISSUERCERT, path.as_ref()) } + /// Set the issuer SSL certificate using an in-memory blob. + /// + /// The specified byte buffer should contain the binary content of a CA + /// certificate in the PEM format. The certificate will be copied into the + /// handle. + /// + /// By default this option is not set and corresponds to + /// `CURLOPT_ISSUERCERT_BLOB`. + pub fn issuer_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error> { + self.setopt_blob(curl_sys::CURLOPT_ISSUERCERT_BLOB, blob) + } + /// Specify directory holding CA certificates /// /// Names a directory holding multiple CA certificates to verify the peer @@ -2184,23 +2267,24 @@ self.setopt_long(curl_sys::CURLOPT_CERTINFO, enable as c_long) } - // /// Set pinned public key. - // /// - // /// Pass a pointer to a zero terminated string as parameter. The string can - // /// be the file name of your pinned public key. The file format expected is - // /// "PEM" or "DER". The string can also be any number of base64 encoded - // /// sha256 hashes preceded by "sha256//" and separated by ";" - // /// - // /// When negotiating a TLS or SSL connection, the server sends a certificate - // /// indicating its identity. A public key is extracted from this certificate - // /// and if it does not exactly match the public key provided to this option, - // /// curl will abort the connection before sending or receiving any data. - // /// - // /// By default this option is not set and corresponds to - // /// `CURLOPT_PINNEDPUBLICKEY`. - // pub fn pinned_public_key(&mut self, enable: bool) -> Result<(), Error> { - // self.setopt_long(curl_sys::CURLOPT_CERTINFO, enable as c_long) - // } + /// Set pinned public key. + /// + /// Pass a pointer to a zero terminated string as parameter. The string can + /// be the file name of your pinned public key. The file format expected is + /// "PEM" or "DER". The string can also be any number of base64 encoded + /// sha256 hashes preceded by "sha256//" and separated by ";" + /// + /// When negotiating a TLS or SSL connection, the server sends a certificate + /// indicating its identity. A public key is extracted from this certificate + /// and if it does not exactly match the public key provided to this option, + /// curl will abort the connection before sending or receiving any data. + /// + /// By default this option is not set and corresponds to + /// `CURLOPT_PINNEDPUBLICKEY`. + pub fn pinned_public_key(&mut self, pubkey: &str) -> Result<(), Error> { + let key = CString::new(pubkey)?; + self.setopt_str(curl_sys::CURLOPT_PINNEDPUBLICKEY, &key) + } /// Specify a source for random data /// @@ -2304,6 +2388,33 @@ // ========================================================================= // getters + /// Set maximum time to wait for Expect 100 request before sending body. + /// + /// `curl` has internal heuristics that trigger the use of a `Expect` + /// header for large enough request bodies where the client first sends the + /// request header along with an `Expect: 100-continue` header. The server + /// is supposed to validate the headers and respond with a `100` response + /// status code after which `curl` will send the actual request body. + /// + /// However, if the server does not respond to the initial request + /// within `CURLOPT_EXPECT_100_TIMEOUT_MS` then `curl` will send the + /// request body anyways. + /// + /// The best-case scenario is where the request is invalid and the server + /// replies with a `417 Expectation Failed` without having to wait for or process + /// the request body at all. However, this behaviour can also lead to higher + /// total latency since in the best case, an additional server roundtrip is required + /// and in the worst case, the request is delayed by `CURLOPT_EXPECT_100_TIMEOUT_MS`. + /// + /// More info: https://curl.se/libcurl/c/CURLOPT_EXPECT_100_TIMEOUT_MS.html + /// + /// By default this option is not set and corresponds to + /// `CURLOPT_EXPECT_100_TIMEOUT_MS`. + pub fn expect_100_timeout(&mut self, timeout: Duration) -> Result<(), Error> { + let ms = timeout.as_secs() * 1000 + (timeout.subsec_nanos() / 1_000_000) as u64; + self.setopt_long(curl_sys::CURLOPT_EXPECT_100_TIMEOUT_MS, ms as c_long) + } + /// Get info on unmet time conditional /// /// Returns if the condition provided in the previous request didn't match @@ -2658,7 +2769,7 @@ /// if the option isn't supported. pub fn cookies(&mut self) -> Result { unsafe { - let mut list = 0 as *mut _; + let mut list = ptr::null_mut(); let rc = curl_sys::curl_easy_getinfo( self.inner.handle, curl_sys::CURLINFO_COOKIELIST, @@ -2721,6 +2832,21 @@ pub fn perform(&self) -> Result<(), Error> { let ret = unsafe { self.cvt(curl_sys::curl_easy_perform(self.inner.handle)) }; panic::propagate(); + ret + } + + /// Some protocols have "connection upkeep" mechanisms. These mechanisms + /// usually send some traffic on existing connections in order to keep them + /// alive; this can prevent connections from being closed due to overzealous + /// firewalls, for example. + /// + /// Currently the only protocol with a connection upkeep mechanism is + /// HTTP/2: when the connection upkeep interval is exceeded and upkeep() is + /// called, an HTTP/2 PING frame is sent on the connection. + #[cfg(feature = "upkeep_7_62_0")] + pub fn upkeep(&self) -> Result<(), Error> { + let ret = unsafe { self.cvt(curl_sys::curl_easy_upkeep(self.inner.handle)) }; + panic::propagate(); return ret; } @@ -2781,7 +2907,7 @@ let ret = str::from_utf8(CStr::from_ptr(p).to_bytes()).unwrap(); let ret = String::from(ret); curl_sys::curl_free(p as *mut _); - return ret; + ret } } @@ -2815,7 +2941,7 @@ let slice = slice::from_raw_parts(p as *const u8, len as usize); let ret = slice.to_vec(); curl_sys::curl_free(p as *mut _); - return ret; + ret } } @@ -2929,6 +3055,16 @@ } } + fn setopt_blob(&mut self, opt: curl_sys::CURLoption, val: &[u8]) -> Result<(), Error> { + let blob = curl_sys::curl_blob { + data: val.as_ptr() as *const c_void as *mut c_void, + len: val.len(), + flags: curl_sys::CURL_BLOB_COPY, + }; + let blob_ptr = &blob as *const curl_sys::curl_blob; + unsafe { self.cvt(curl_sys::curl_easy_setopt(self.inner.handle, opt, blob_ptr)) } + } + fn getopt_bytes(&mut self, opt: curl_sys::CURLINFO) -> Result, Error> { unsafe { let p = self.getopt_ptr(opt)?; @@ -3011,7 +3147,7 @@ if let Some(msg) = self.take_error_buf() { err.set_extra(msg); } - Err(Error::new(rc)) + Err(err) } } @@ -3019,7 +3155,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Easy") .field("handle", &self.inner.handle) - .field("handler", &self.inner.handle) + .field("handler", &self.inner.handler) .finish() } } @@ -3060,9 +3196,7 @@ let input = slice::from_raw_parts(ptr as *const u8, size * nmemb); match (*(data as *mut Inner)).handler.write(input) { Ok(s) => s, - Err(WriteError::Pause) | Err(WriteError::__Nonexhaustive) => { - curl_sys::CURL_WRITEFUNC_PAUSE - } + Err(WriteError::Pause) => curl_sys::CURL_WRITEFUNC_PAUSE, } }) .unwrap_or(!0) @@ -3079,9 +3213,7 @@ match (*(data as *mut Inner)).handler.read(input) { Ok(s) => s, Err(ReadError::Pause) => curl_sys::CURL_READFUNC_PAUSE, - Err(ReadError::__Nonexhaustive) | Err(ReadError::Abort) => { - curl_sys::CURL_READFUNC_ABORT - } + Err(ReadError::Abort) => curl_sys::CURL_READFUNC_ABORT, } }) .unwrap_or(!0) @@ -3145,7 +3277,7 @@ }; (*(userptr as *mut Inner)).handler.debug(kind, data) }); - return 0; + 0 } extern "C" fn ssl_ctx_cb( @@ -3291,6 +3423,17 @@ self.flag(curl_sys::CURLAUTH_NTLM_WB, on) } + /// HTTP AWS V4 signature authentication. + /// + /// This is a special auth type that can't be combined with the others. + /// It will override the other auth types you might have set. + /// + /// Enabling this auth type is the same as using "aws:amz" as param in + /// [`Easy2::aws_sigv4`](struct.Easy2.html#method.aws_sigv4) method. + pub fn aws_sigv4(&mut self, on: bool) -> &mut Auth { + self.flag(curl_sys::CURLAUTH_AWS_SIGV4, on) + } + fn flag(&mut self, bit: c_ulong, on: bool) -> &mut Auth { if on { self.bits |= bit as c_long; @@ -3314,6 +3457,7 @@ ) .field("ntlm", &(bits & curl_sys::CURLAUTH_NTLM != 0)) .field("ntlm_wb", &(bits & curl_sys::CURLAUTH_NTLM_WB != 0)) + .field("aws_sigv4", &(bits & curl_sys::CURLAUTH_AWS_SIGV4 != 0)) .finish() } } diff -Nru rust-curl-0.4.33/src/easy/handle.rs rust-curl-0.4.39/src/easy/handle.rs --- rust-curl-0.4.33/src/easy/handle.rs 2020-07-23 00:00:26.000000000 +0000 +++ rust-curl-0.4.39/src/easy/handle.rs 1973-11-29 21:33:09.000000000 +0000 @@ -9,12 +9,12 @@ use curl_sys; use libc::c_void; -use easy::handler::{self, InfoType, ReadError, SeekResult, WriteError}; -use easy::handler::{Auth, NetRc, ProxyType, SslOpt}; -use easy::handler::{HttpVersion, IpResolve, SslVersion, TimeCondition}; -use easy::{Easy2, Handler}; -use easy::{Form, List}; -use Error; +use crate::easy::handler::{self, InfoType, ReadError, SeekResult, WriteError}; +use crate::easy::handler::{Auth, NetRc, ProxyType, SslOpt}; +use crate::easy::handler::{HttpVersion, IpResolve, SslVersion, TimeCondition}; +use crate::easy::{Easy2, Handler}; +use crate::easy::{Form, List}; +use crate::Error; /// Raw bindings to a libcurl "easy session". /// @@ -563,6 +563,11 @@ self.inner.connect_to(list) } + /// Same as [`Easy2::path_as_is`](struct.Easy2.html#method.path_as_is) + pub fn path_as_is(&mut self, as_is: bool) -> Result<(), Error> { + self.inner.path_as_is(as_is) + } + /// Same as [`Easy2::proxy`](struct.Easy2.html#method.proxy) pub fn proxy(&mut self, url: &str) -> Result<(), Error> { self.inner.proxy(url) @@ -588,11 +593,21 @@ self.inner.proxy_sslcert(sslcert) } + /// Same as [`Easy2::proxy_sslcert_blob`](struct.Easy2.html#method.proxy_sslcert_blob) + pub fn proxy_sslcert_blob(&mut self, blob: &[u8]) -> Result<(), Error> { + self.inner.proxy_sslcert_blob(blob) + } + /// 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_sslkey_blob`](struct.Easy2.html#method.proxy_sslkey_blob) + pub fn proxy_sslkey_blob(&mut self, blob: &[u8]) -> Result<(), Error> { + self.inner.proxy_sslkey_blob(blob) + } + /// 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) @@ -638,6 +653,11 @@ self.inner.buffer_size(size) } + /// Same as [`Easy2::upload_buffer_size`](struct.Easy2.html#method.upload_buffer_size) + pub fn upload_buffer_size(&mut self, size: usize) -> Result<(), Error> { + self.inner.upload_buffer_size(size) + } + /// Same as [`Easy2::tcp_nodelay`](struct.Easy2.html#method.tcp_nodelay) pub fn tcp_nodelay(&mut self, enable: bool) -> Result<(), Error> { self.inner.tcp_nodelay(enable) @@ -681,6 +701,11 @@ self.inner.http_auth(auth) } + /// Same as [`Easy2::aws_sigv4`](struct.Easy2.html#method.aws_sigv4) + pub fn aws_sigv4(&mut self, param: &str) -> Result<(), Error> { + self.inner.aws_sigv4(param) + } + /// Same as [`Easy2::proxy_username`](struct.Easy2.html#method.proxy_username) pub fn proxy_username(&mut self, user: &str) -> Result<(), Error> { self.inner.proxy_username(user) @@ -905,6 +930,11 @@ self.inner.max_connects(max) } + /// Same as [`Easy2::maxage_conn`](struct.Easy2.html#method.maxage_conn) + pub fn maxage_conn(&mut self, max_age: Duration) -> Result<(), Error> { + self.inner.maxage_conn(max_age) + } + /// Same as [`Easy2::fresh_connect`](struct.Easy2.html#method.fresh_connect) pub fn fresh_connect(&mut self, enable: bool) -> Result<(), Error> { self.inner.fresh_connect(enable) @@ -943,6 +973,11 @@ self.inner.ssl_cert(cert) } + /// Same as [`Easy2::ssl_cert_blob`](struct.Easy2.html#method.ssl_cert_blob) + pub fn ssl_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error> { + self.inner.ssl_cert_blob(blob) + } + /// Same as [`Easy2::ssl_cert_type`](struct.Easy2.html#method.ssl_cert_type) pub fn ssl_cert_type(&mut self, kind: &str) -> Result<(), Error> { self.inner.ssl_cert_type(kind) @@ -953,6 +988,11 @@ self.inner.ssl_key(key) } + /// Same as [`Easy2::ssl_key_blob`](struct.Easy2.html#method.ssl_key_blob) + pub fn ssl_key_blob(&mut self, blob: &[u8]) -> Result<(), Error> { + self.inner.ssl_key_blob(blob) + } + /// Same as [`Easy2::ssl_key_type`](struct.Easy2.html#method.ssl_key_type) pub fn ssl_key_type(&mut self, kind: &str) -> Result<(), Error> { self.inner.ssl_key_type(kind) @@ -1012,6 +1052,11 @@ self.inner.issuer_cert(path) } + /// Same as [`Easy2::issuer_cert_blob`](struct.Easy2.html#method.issuer_cert_blob) + pub fn issuer_cert_blob(&mut self, blob: &[u8]) -> Result<(), Error> { + self.inner.issuer_cert_blob(blob) + } + /// Same as [`Easy2::capath`](struct.Easy2.html#method.capath) pub fn capath>(&mut self, path: P) -> Result<(), Error> { self.inner.capath(path) @@ -1052,6 +1097,11 @@ self.inner.ssl_options(bits) } + /// Same as [`Easy2::pinned_public_key`](struct.Easy2.html#method.pinned_public_key) + pub fn pinned_public_key(&mut self, pubkey: &str) -> Result<(), Error> { + self.inner.pinned_public_key(pubkey) + } + // ========================================================================= // getters @@ -1251,6 +1301,12 @@ } } + /// Same as [`Easy2::upkeep`](struct.Easy2.html#method.upkeep) + #[cfg(feature = "upkeep_7_62_0")] + pub fn upkeep(&self) -> Result<(), Error> { + self.inner.upkeep() + } + /// Same as [`Easy2::unpause_read`](struct.Easy2.html#method.unpause_read) pub fn unpause_read(&self) -> Result<(), Error> { self.inner.unpause_read() @@ -1499,6 +1555,12 @@ self.easy.do_perform() } + /// Same as `Easy::upkeep` + #[cfg(feature = "upkeep_7_62_0")] + pub fn upkeep(&self) -> Result<(), Error> { + self.easy.upkeep() + } + /// Same as `Easy::unpause_read`. pub fn unpause_read(&self) -> Result<(), Error> { self.easy.unpause_read() diff -Nru rust-curl-0.4.33/src/easy/list.rs rust-curl-0.4.39/src/easy/list.rs --- rust-curl-0.4.33/src/easy/list.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/src/easy/list.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,8 +1,9 @@ use std::ffi::{CStr, CString}; use std::fmt; +use std::ptr; +use crate::Error; use curl_sys; -use Error; /// A linked list of a strings pub struct List { @@ -21,7 +22,7 @@ } pub unsafe fn from_raw(raw: *mut curl_sys::curl_slist) -> List { - List { raw: raw } + List { raw } } unsafe impl Send for List {} @@ -29,7 +30,9 @@ impl List { /// Creates a new empty list of strings. pub fn new() -> List { - List { raw: 0 as *mut _ } + List { + raw: ptr::null_mut(), + } } /// Appends some data into this list. @@ -86,7 +89,7 @@ unsafe { let ret = Some(CStr::from_ptr((*self.cur).data).to_bytes()); self.cur = (*self.cur).next; - return ret; + ret } } } diff -Nru rust-curl-0.4.33/src/easy/windows.rs rust-curl-0.4.39/src/easy/windows.rs --- rust-curl-0.4.33/src/easy/windows.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/src/easy/windows.rs 1973-11-29 21:33:09.000000000 +0000 @@ -4,15 +4,14 @@ #[cfg(target_env = "msvc")] mod win { - extern crate winapi; - use self::winapi::ctypes::*; - use self::winapi::um::libloaderapi::*; - use self::winapi::um::wincrypt::*; use schannel::cert_context::ValidUses; use schannel::cert_store::CertStore; use std::ffi::CString; use std::mem; use std::ptr; + use winapi::ctypes::*; + use winapi::um::libloaderapi::*; + use winapi::um::wincrypt::*; fn lookup(module: &str, symbol: &str) -> Option<*const c_void> { unsafe { @@ -75,7 +74,7 @@ pub unsafe fn add_certs_to_context(ssl_ctx: *mut c_void) { // check the runtime version of OpenSSL - let openssl = match ::version::Version::get().ssl_version() { + let openssl = match crate::version::Version::get().ssl_version() { Some(ssl_ver) if ssl_ver.starts_with("OpenSSL/1.1.0") => { lookup_functions("libcrypto", "libssl") } diff -Nru rust-curl-0.4.33/src/error.rs rust-curl-0.4.39/src/error.rs --- rust-curl-0.4.33/src/error.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/src/error.rs 1973-11-29 21:33:09.000000000 +0000 @@ -18,10 +18,7 @@ impl Error { /// Creates a new error from the underlying code returned by libcurl. pub fn new(code: curl_sys::CURLcode) -> Error { - Error { - code: code, - extra: None, - } + Error { code, extra: None } } /// Stores some extra information about this error inside this error. @@ -315,7 +312,7 @@ /// 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) + self.extra.as_deref() } } @@ -352,7 +349,7 @@ impl ShareError { /// Creates a new error from the underlying code returned by libcurl. pub fn new(code: curl_sys::CURLSHcode) -> ShareError { - ShareError { code: code } + ShareError { code } } /// Returns whether this error corresponds to CURLSHE_BAD_OPTION. @@ -425,7 +422,7 @@ impl MultiError { /// Creates a new error from the underlying code returned by libcurl. pub fn new(code: curl_sys::CURLMcode) -> MultiError { - MultiError { code: code } + MultiError { code } } /// Returns whether this error corresponds to CURLM_BAD_HANDLE. @@ -511,7 +508,7 @@ impl FormError { /// Creates a new error from the underlying code returned by libcurl. pub fn new(code: curl_sys::CURLFORMcode) -> FormError { - FormError { code: code } + FormError { code } } /// Returns whether this error corresponds to CURL_FORMADD_MEMORY. diff -Nru rust-curl-0.4.33/src/lib.rs rust-curl-0.4.39/src/lib.rs --- rust-curl-0.4.33/src/lib.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/src/lib.rs 1973-11-29 21:33:09.000000000 +0000 @@ -56,26 +56,14 @@ #![deny(missing_docs, missing_debug_implementations)] #![doc(html_root_url = "https://docs.rs/curl/0.4")] -extern crate curl_sys; -extern crate libc; -extern crate socket2; - -#[cfg(need_openssl_probe)] -extern crate openssl_probe; -#[cfg(need_openssl_init)] -extern crate openssl_sys; - -#[cfg(target_env = "msvc")] -extern crate schannel; - use std::ffi::CStr; use std::str; use std::sync::Once; -pub use error::{Error, FormError, MultiError, ShareError}; +pub use crate::error::{Error, FormError, MultiError, ShareError}; mod error; -pub use version::{Protocols, Version}; +pub use crate::version::{Protocols, Version}; mod version; pub mod easy; diff -Nru rust-curl-0.4.33/src/multi.rs rust-curl-0.4.39/src/multi.rs --- rust-curl-0.4.33/src/multi.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/src/multi.rs 1973-11-29 21:33:09.000000000 +0000 @@ -2,6 +2,7 @@ use std::fmt; use std::marker; +use std::ptr; use std::time::Duration; use curl_sys; @@ -10,9 +11,9 @@ #[cfg(unix)] use libc::{pollfd, POLLIN, POLLOUT, POLLPRI}; -use easy::{Easy, Easy2, List}; -use panic; -use {Error, MultiError}; +use crate::easy::{Easy, Easy2, List}; +use crate::panic; +use crate::{Error, MultiError}; /// A multi handle for initiating multiple connections simultaneously. /// @@ -96,7 +97,7 @@ /// initiated. pub fn new() -> Multi { unsafe { - ::init(); + crate::init(); let ptr = curl_sys::curl_multi_init(); assert!(!ptr.is_null()); Multi { @@ -379,7 +380,7 @@ cvt(curl_sys::curl_multi_add_handle(self.raw, easy.raw()))?; } Ok(EasyHandle { - easy: easy, + easy, _marker: marker::PhantomData, }) } @@ -390,7 +391,7 @@ cvt(curl_sys::curl_multi_add_handle(self.raw, easy.raw()))?; } Ok(Easy2Handle { - easy: easy, + easy, _marker: marker::PhantomData, }) } @@ -448,10 +449,7 @@ if ptr.is_null() { break; } - f(Message { - ptr: ptr, - _multi: self, - }) + f(Message { ptr, _multi: self }) } } } @@ -579,7 +577,7 @@ // Duration too large, clamp at maximum value. i32::max_value() } else { - secs as i32 * 1000 + timeout.subsec_nanos() as i32 / 1000_000 + secs as i32 * 1000 + timeout.subsec_nanos() as i32 / 1_000_000 } }; unsafe { @@ -682,9 +680,9 @@ ) -> Result, MultiError> { unsafe { let mut ret = 0; - let read = read.map(|r| r as *mut _).unwrap_or(0 as *mut _); - let write = write.map(|r| r as *mut _).unwrap_or(0 as *mut _); - let except = except.map(|r| r as *mut _).unwrap_or(0 as *mut _); + let read = read.map(|r| r as *mut _).unwrap_or(ptr::null_mut()); + let write = write.map(|r| r as *mut _).unwrap_or(ptr::null_mut()); + let except = except.map(|r| r as *mut _).unwrap_or(ptr::null_mut()); cvt(curl_sys::curl_multi_fdset( self.raw, read, write, except, &mut ret, ))?; @@ -801,7 +799,7 @@ /// easy handle. pub fn set_token(&mut self, token: usize) -> Result<(), Error> { unsafe { - ::cvt(curl_sys::curl_easy_setopt( + crate::cvt(curl_sys::curl_easy_setopt( self.easy.raw(), curl_sys::CURLOPT_PRIVATE, token, @@ -865,7 +863,7 @@ /// Same as `EasyHandle::set_token` pub fn set_token(&mut self, token: usize) -> Result<(), Error> { unsafe { - ::cvt(curl_sys::curl_easy_setopt( + crate::cvt(curl_sys::curl_easy_setopt( self.easy.raw(), curl_sys::CURLOPT_PRIVATE, token, @@ -928,7 +926,7 @@ pub fn result(&self) -> Option> { unsafe { if (*self.ptr).msg == curl_sys::CURLMSG_DONE { - Some(::cvt((*self.ptr).data as curl_sys::CURLcode)) + Some(crate::cvt((*self.ptr).data as curl_sys::CURLcode)) } else { None } @@ -950,7 +948,7 @@ e.set_extra(s); } } - return err; + err } /// Same as `result`, except only returns `Some` for the specified handle. @@ -968,7 +966,7 @@ e.set_extra(s); } } - return err; + err } /// Returns whether this easy message was for the specified easy handle or @@ -991,7 +989,7 @@ pub fn token(&self) -> Result { unsafe { let mut p = 0usize; - ::cvt(curl_sys::curl_easy_getinfo( + crate::cvt(curl_sys::curl_easy_getinfo( (*self.ptr).easy_handle, curl_sys::CURLINFO_PRIVATE, &mut p, @@ -1043,8 +1041,8 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Events") .field("input", &(self.bits & curl_sys::CURL_CSELECT_IN != 0)) - .field("output", &(self.bits & curl_sys::CURL_CSELECT_IN != 0)) - .field("error", &(self.bits & curl_sys::CURL_CSELECT_IN != 0)) + .field("output", &(self.bits & curl_sys::CURL_CSELECT_OUT != 0)) + .field("error", &(self.bits & curl_sys::CURL_CSELECT_ERR != 0)) .finish() } } @@ -1167,7 +1165,7 @@ WaitFd { inner: curl_sys::curl_waitfd { fd: pfd.fd, - events: events, + events, revents: 0, }, } diff -Nru rust-curl-0.4.33/src/version.rs rust-curl-0.4.39/src/version.rs --- rust-curl-0.4.33/src/version.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/src/version.rs 1973-11-29 21:33:09.000000000 +0000 @@ -40,7 +40,7 @@ /// Returns the human readable version string, pub fn version(&self) -> &str { - unsafe { ::opt_str((*self.inner).version).unwrap() } + unsafe { crate::opt_str((*self.inner).version).unwrap() } } /// Returns a numeric representation of the version number @@ -51,11 +51,16 @@ unsafe { (*self.inner).version_num as u32 } } + /// Returns true if this was built with the vendored version of libcurl. + pub fn vendored(&self) -> bool { + curl_sys::vendored() + } + /// Returns a human readable string of the host libcurl is built for. /// /// This is discovered as part of the build environment. pub fn host(&self) -> &str { - unsafe { ::opt_str((*self.inner).host).unwrap() } + unsafe { crate::opt_str((*self.inner).host).unwrap() } } /// Returns whether libcurl supports IPv6 @@ -151,6 +156,31 @@ self.flag(curl_sys::CURL_VERSION_BROTLI) } + /// Returns whether libcurl was built with support for Alt-Svc. + pub fn feature_altsvc(&self) -> bool { + self.flag(curl_sys::CURL_VERSION_ALTSVC) + } + + /// Returns whether libcurl was built with support for zstd + pub fn feature_zstd(&self) -> bool { + self.flag(curl_sys::CURL_VERSION_ZSTD) + } + + /// Returns whether libcurl was built with support for unicode + pub fn feature_unicode(&self) -> bool { + self.flag(curl_sys::CURL_VERSION_UNICODE) + } + + /// Returns whether libcurl was built with support for hsts + pub fn feature_hsts(&self) -> bool { + self.flag(curl_sys::CURL_VERSION_HSTS) + } + + /// Returns whether libcurl was built with support for gsasl + pub fn feature_gsasl(&self) -> bool { + self.flag(curl_sys::CURL_VERSION_GSASL) + } + fn flag(&self, flag: c_int) -> bool { unsafe { (*self.inner).features & flag != 0 } } @@ -158,13 +188,13 @@ /// Returns the version of OpenSSL that is used, or None if there is no SSL /// support. pub fn ssl_version(&self) -> Option<&str> { - unsafe { ::opt_str((*self.inner).ssl_version) } + unsafe { crate::opt_str((*self.inner).ssl_version) } } /// Returns the version of libz that is used, or None if there is no libz /// support. pub fn libz_version(&self) -> Option<&str> { - unsafe { ::opt_str((*self.inner).libz_version) } + unsafe { crate::opt_str((*self.inner).libz_version) } } /// Returns an iterator over the list of protocols that this build of @@ -183,7 +213,7 @@ pub fn ares_version(&self) -> Option<&str> { unsafe { if (*self.inner).age >= curl_sys::CURLVERSION_SECOND { - ::opt_str((*self.inner).ares) + crate::opt_str((*self.inner).ares) } else { None } @@ -205,7 +235,7 @@ pub fn libidn_version(&self) -> Option<&str> { unsafe { if (*self.inner).age >= curl_sys::CURLVERSION_THIRD { - ::opt_str((*self.inner).libidn) + crate::opt_str((*self.inner).libidn) } else { None } @@ -227,7 +257,7 @@ pub fn libssh_version(&self) -> Option<&str> { unsafe { if (*self.inner).age >= curl_sys::CURLVERSION_FOURTH { - ::opt_str((*self.inner).libssh_version) + crate::opt_str((*self.inner).libssh_version) } else { None } @@ -249,7 +279,7 @@ pub fn brotli_version(&self) -> Option<&str> { unsafe { if (*self.inner).age >= curl_sys::CURLVERSION_FIFTH { - ::opt_str((*self.inner).brotli_version) + crate::opt_str((*self.inner).brotli_version) } else { None } @@ -271,7 +301,7 @@ pub fn nghttp2_version(&self) -> Option<&str> { unsafe { if (*self.inner).age >= curl_sys::CURLVERSION_SIXTH { - ::opt_str((*self.inner).nghttp2_version) + crate::opt_str((*self.inner).nghttp2_version) } else { None } @@ -282,7 +312,7 @@ pub fn quic_version(&self) -> Option<&str> { unsafe { if (*self.inner).age >= curl_sys::CURLVERSION_SIXTH { - ::opt_str((*self.inner).quic_version) + crate::opt_str((*self.inner).quic_version) } else { None } @@ -293,7 +323,7 @@ pub fn cainfo(&self) -> Option<&str> { unsafe { if (*self.inner).age >= curl_sys::CURLVERSION_SEVENTH { - ::opt_str((*self.inner).cainfo) + crate::opt_str((*self.inner).cainfo) } else { None } @@ -304,7 +334,53 @@ pub fn capath(&self) -> Option<&str> { unsafe { if (*self.inner).age >= curl_sys::CURLVERSION_SEVENTH { - ::opt_str((*self.inner).capath) + crate::opt_str((*self.inner).capath) + } else { + None + } + } + } + + /// If avaiable, the numeric zstd version + /// + /// Represented as `(MAJOR << 24) | (MINOR << 12) | PATCH` + pub fn zstd_ver_num(&self) -> Option { + unsafe { + if (*self.inner).age >= curl_sys::CURLVERSION_EIGHTH { + Some((*self.inner).zstd_ver_num) + } else { + None + } + } + } + + /// If available, the human readable version of zstd + pub fn zstd_version(&self) -> Option<&str> { + unsafe { + if (*self.inner).age >= curl_sys::CURLVERSION_EIGHTH { + crate::opt_str((*self.inner).zstd_version) + } else { + None + } + } + } + + /// If available, the human readable version of hyper + pub fn hyper_version(&self) -> Option<&str> { + unsafe { + if (*self.inner).age >= curl_sys::CURLVERSION_NINTH { + crate::opt_str((*self.inner).hyper_version) + } else { + None + } + } + } + + /// If available, the human readable version of hyper + pub fn gsasl_version(&self) -> Option<&str> { + unsafe { + if (*self.inner).age >= curl_sys::CURLVERSION_TENTH { + crate::opt_str((*self.inner).gsasl_version) } else { None } @@ -316,6 +392,9 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut f = f.debug_struct("Version"); f.field("version", &self.version()) + .field("rust_crate_version", &env!("CARGO_PKG_VERSION")) + .field("rust_sys_crate_version", &curl_sys::rust_crate_version()) + .field("vendored", &self.vendored()) .field("host", &self.host()) .field("feature_ipv6", &self.feature_ipv6()) .field("feature_ssl", &self.feature_ssl()) @@ -334,7 +413,14 @@ .field( "feature_unix_domain_socket", &self.feature_unix_domain_socket(), - ); + ) + .field("feature_altsvc", &self.feature_altsvc()) + .field("feature_zstd", &self.feature_zstd()) + .field("feature_unicode", &self.feature_unicode()) + .field("feature_http3", &self.feature_http3()) + .field("feature_http2", &self.feature_http2()) + .field("feature_gsasl", &self.feature_gsasl()) + .field("feature_brotli", &self.feature_brotli()); if let Some(s) = self.ssl_version() { f.field("ssl_version", &s); @@ -369,6 +455,24 @@ if let Some(s) = self.quic_version() { f.field("quic_version", &s); } + if let Some(s) = self.zstd_ver_num() { + f.field("zstd_ver_num", &format!("{:x}", s)); + } + if let Some(s) = self.zstd_version() { + f.field("zstd_version", &s); + } + if let Some(s) = self.cainfo() { + f.field("cainfo", &s); + } + if let Some(s) = self.capath() { + f.field("capath", &s); + } + if let Some(s) = self.hyper_version() { + f.field("hyper_version", &s); + } + if let Some(s) = self.gsasl_version() { + f.field("gsasl_version", &s); + } f.field("protocols", &self.protocols().collect::>()); @@ -384,7 +488,7 @@ if (*self.cur).is_null() { return None; } - let ret = ::opt_str(*self.cur).unwrap(); + let ret = crate::opt_str(*self.cur).unwrap(); self.cur = self.cur.offset(1); Some(ret) } diff -Nru rust-curl-0.4.33/tests/atexit.rs rust-curl-0.4.39/tests/atexit.rs --- rust-curl-0.4.33/tests/atexit.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/tests/atexit.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,6 +1,3 @@ -extern crate curl; -extern crate libc; - use curl::easy::Easy; pub extern "C" fn hook() { diff -Nru rust-curl-0.4.33/tests/easy.rs rust-curl-0.4.39/tests/easy.rs --- rust-curl-0.4.33/tests/easy.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/tests/easy.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,5 +1,3 @@ -extern crate curl; - use std::cell::{Cell, RefCell}; use std::io::Read; use std::rc::Rc; @@ -16,8 +14,9 @@ } use curl::easy::{Easy, List, ReadError, Transfer, WriteError}; +use curl::Version; -use server::Server; +use crate::server::Server; mod server; fn handle() -> Easy { @@ -302,6 +301,12 @@ // t!(h.tcp_keepidle(Duration::new(3, 0))); // t!(h.tcp_keepintvl(Duration::new(3, 0))); t!(h.buffer_size(10)); + + if Version::get().version_num() >= 0x073e00 { + // only available on curl 7.62.0 or later: + t!(h.upload_buffer_size(10)); + } + t!(h.dns_cache_timeout(Duration::new(1, 0))); } @@ -828,3 +833,50 @@ t!(h.post_fields_copy(b"data\n")); t!(h.perform()); } + +#[cfg(feature = "upkeep_7_62_0")] +#[test] +fn test_upkeep() { + let s = Server::new(); + s.receive( + "\ + GET / HTTP/1.1\r\n\ + Host: 127.0.0.1:$PORT\r\n\ + Accept: */*\r\n\ + \r\n", + ); + s.send("HTTP/1.1 200 OK\r\n\r\n"); + + let mut handle = handle(); + t!(handle.url(&s.url("/"))); + t!(handle.perform()); + + // Ensure that upkeep can be called on the handle without problem. + t!(handle.upkeep()); +} + +#[test] +fn path_as_is() { + let s = Server::new(); + s.receive( + "\ + GET /test/../ HTTP/1.1\r\n\ + Host: 127.0.0.1:$PORT\r\n\ + Accept: */*\r\n\ + \r\n", + ); + s.send( + "\ + HTTP/1.1 200 OK\r\n\ + \r\n", + ); + + let mut h = handle(); + t!(h.url(&s.url("/test/../"))); + t!(h.path_as_is(true)); + t!(h.perform()); + + let addr = format!("http://{}/test/../", s.addr()); + assert_eq!(t!(h.response_code()), 200); + assert_eq!(t!(h.effective_url()), Some(&addr[..])); +} diff -Nru rust-curl-0.4.33/tests/multi.rs rust-curl-0.4.39/tests/multi.rs --- rust-curl-0.4.33/tests/multi.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/tests/multi.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,9 +1,5 @@ #![cfg(unix)] -extern crate curl; -extern crate mio; -extern crate mio_extras; - use std::collections::HashMap; use std::io::{Cursor, Read}; use std::time::Duration; @@ -20,7 +16,7 @@ }; } -use server::Server; +use crate::server::Server; mod server; #[test] @@ -169,7 +165,7 @@ if events.remove() { token_map.remove(&token).unwrap(); } else { - let mut e = mio::Ready::none(); + let mut e = mio::Ready::empty(); if events.input() { e = e | mio::Ready::readable(); } @@ -208,13 +204,13 @@ let token = event.token(); let socket = token_map[&token.into()]; let mut e = Events::new(); - if event.kind().is_readable() { + if event.readiness().is_readable() { e.input(true); } - if event.kind().is_writable() { + if event.readiness().is_writable() { e.output(true); } - if event.kind().is_error() { + if mio::unix::UnixReady::from(event.readiness()).is_error() { e.error(true); } let remaining = t!(m.action(socket, &e)); diff -Nru rust-curl-0.4.33/tests/post.rs rust-curl-0.4.39/tests/post.rs --- rust-curl-0.4.33/tests/post.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/tests/post.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,5 +1,3 @@ -extern crate curl; - use std::time::Duration; macro_rules! t { @@ -13,7 +11,7 @@ use curl::easy::{Easy, Form, List}; -use server::Server; +use crate::server::Server; mod server; fn handle() -> Easy { diff -Nru rust-curl-0.4.33/tests/protocols.rs rust-curl-0.4.39/tests/protocols.rs --- rust-curl-0.4.33/tests/protocols.rs 2020-07-18 02:50:13.000000000 +0000 +++ rust-curl-0.4.39/tests/protocols.rs 1973-11-29 21:33:09.000000000 +0000 @@ -1,5 +1,3 @@ -extern crate curl; - #[cfg(all(feature = "static-curl", not(feature = "protocol-ftp")))] #[test] fn static_with_ftp_disabled() {