Skip to content

Commit

Permalink
Merge branch 'alexcrichton:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dovreshef authored Nov 3, 2021
2 parents 9da634e + 433fbce commit f689c5c
Show file tree
Hide file tree
Showing 33 changed files with 1,387 additions and 406 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
time: "08:00"
open-pull-requests-limit: 10
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI
on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

jobs:
test:
Expand Down Expand Up @@ -134,4 +134,4 @@ jobs:
git add .
git -c user.name='ci' -c user.email='ci' commit -m init
git push -f -q https://git:${{ secrets.github_token }}@github.com/${{ github.repository }} HEAD:gh-pages
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Cargo.lock
target/
.idea/
27 changes: 24 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
[package]
name = "curl"
version = "0.4.29"
version = "0.4.40"
authors = ["Alex Crichton <[email protected]>"]
license = "MIT"
repository = "https://github.com/alexcrichton/curl-rust"
homepage = "https://github.com/alexcrichton/curl-rust"
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
edition = "2018"

[badges]
travis-ci = { repository = "alexcrichton/curl-rust" }
appveyor = { repository = "alexcrichton/curl-rust" }

[dependencies]
libc = "0.2.42"
curl-sys = { path = "curl-sys", version = "0.4.31", default-features = false }
socket2 = "0.3.7"
curl-sys = { path = "curl-sys", version = "0.4.50", 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]
Expand All @@ -31,6 +33,7 @@ winapi = { version = '0.3', features = ['libloaderapi', 'wincrypt'] }
[dev-dependencies]
mio = "0.6"
mio-extras = "2.0.3"
anyhow = "1.0.31"

[workspace]
members = ["systest"]
Expand All @@ -45,7 +48,25 @@ 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"]
upkeep_7_62_0 = ["curl-sys/upkeep_7_62_0"]
poll_7_68_0 = ["curl-sys/poll_7_68_0"]

[[test]]
name = "atexit"
harness = false

[[example]]
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"]
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -125,6 +128,8 @@ with various Cargo features:
- `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.
- `poll_7_68_0`: Enable curl_multi_poll()/curl_multi_wakeup() support, requires curl 7.68.0 or later. Disabled by default.

## Version Support

Expand All @@ -145,8 +150,7 @@ If you encounter the following error message:
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

Expand All @@ -156,10 +160,12 @@ In order to avoid this failure you can either

## 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
Expand Down
9 changes: 4 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use std::env;
use std::str::FromStr;

fn main() {
// OpenSSL >= 1.1.0 can be initialized concurrently and is initialized correctly by libcurl.
// <= 1.0.2 need locking callbacks, which are provided by openssl_sys::init().
let use_openssl = match env::var("DEP_OPENSSL_VERSION") {
Ok(ver) => {
let ver = u32::from_str(&ver).unwrap();
if ver < 110 {
let use_openssl = match env::var("DEP_OPENSSL_VERSION_NUMBER") {
Ok(version) => {
let version = u64::from_str_radix(&version, 16).unwrap();
if version < 0x1_01_00_00_0 {
println!("cargo:rustc-cfg=need_openssl_init");
}
true
Expand Down
2 changes: 1 addition & 1 deletion ci/Dockerfile-linux64-curl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:14.04
FROM ubuntu:16.04

RUN apt-get update
RUN apt-get install -y --no-install-recommends \
Expand Down
6 changes: 6 additions & 0 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ if [ -z "$NO_RUN" ]; then
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
8 changes: 6 additions & 2 deletions curl-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "curl-sys"
version = "0.4.31+curl-7.70.0"
version = "0.4.50+curl-7.79.1"
authors = ["Alex Crichton <[email protected]>"]
links = "curl"
build = "build.rs"
Expand All @@ -9,6 +9,7 @@ repository = "https://github.com/alexcrichton/curl-rust"
description = "Native bindings to the libcurl library"
documentation = "https://docs.rs/curl-sys"
categories = ["external-ffi-bindings"]
edition = "2018"

[badges]
travis-ci = { repository = "alexcrichton/curl-rust" }
Expand All @@ -19,7 +20,7 @@ name = "curl_sys"
path = "lib.rs"

[dependencies]
libz-sys = "1.0.18"
libz-sys = { version = "1.0.18", default-features = false, features = ["libc"] }
libc = "0.2.2"
libnghttp2-sys = { optional = true, version = "0.1.3" }

Expand Down Expand Up @@ -51,3 +52,6 @@ static-ssl = ["openssl-sys/vendored"]
spnego = []
force-system-lib-on-osx = []
protocol-ftp = []
zlib-ng-compat = ["libz-sys/zlib-ng", "static-curl"]
upkeep_7_62_0 = []
poll_7_68_0 = []
Loading

0 comments on commit f689c5c

Please sign in to comment.