Skip to content

Commit

Permalink
Merge pull request #532 from ecnelises/8_4_0
Browse files Browse the repository at this point in the history
Update to curl 8.4.0
  • Loading branch information
ehuss authored Oct 11, 2023
2 parents 4f10982 + 6b7e62b commit de57280
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion 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.67+curl-8.3.0"
version = "0.4.68+curl-8.4.0"
authors = ["Alex Crichton <[email protected]>"]
links = "curl"
build = "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion curl-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn main() {
.replace("@LIBCURL_LIBS@", "")
.replace("@SUPPORT_FEATURES@", "")
.replace("@SUPPORT_PROTOCOLS@", "")
.replace("@CURLVERSION@", "8.3.0"),
.replace("@CURLVERSION@", "8.4.0"),
)
.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion curl-sys/curl
Submodule curl updated 2020 files
1 change: 0 additions & 1 deletion tests/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ fn upload_lots() {

let e = t!(m.add(h));

assert!(t!(m.perform()) > 0);
let mut next_token = 1;
let mut token_map = HashMap::new();
let mut cur_timeout = None;
Expand Down
30 changes: 23 additions & 7 deletions tests/post.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use curl::Version;
use std::time::Duration;

macro_rules! t {
Expand All @@ -23,23 +24,35 @@ fn handle() -> Easy {
e
}

fn multipart_boundary_size() -> usize {
// Versions before 8.4.0 used a smaller multipart mime boundary, so the
// exact content-length will differ between versions.
if Version::get().version_num() >= 0x80400 {
148
} else {
136
}
}

#[test]
fn custom() {
multipart_boundary_size();
let s = Server::new();
s.receive(
s.receive(&format!(
"\
POST / HTTP/1.1\r\n\
Host: 127.0.0.1:$PORT\r\n\
Accept: */*\r\n\
Content-Length: 142\r\n\
Content-Length: {}\r\n\
Content-Type: multipart/form-data; boundary=--[..]\r\n\
\r\n\
--[..]\r\n\
Content-Disposition: form-data; name=\"foo\"\r\n\
\r\n\
1234\r\n\
--[..]\r\n",
);
multipart_boundary_size() + 6
));
s.send("HTTP/1.1 200 OK\r\n\r\n");

let mut handle = handle();
Expand All @@ -50,15 +63,16 @@ fn custom() {
t!(handle.perform());
}

#[cfg(feature = "static-curl")]
#[test]
fn buffer() {
let s = Server::new();
s.receive(
s.receive(&format!(
"\
POST / HTTP/1.1\r\n\
Host: 127.0.0.1:$PORT\r\n\
Accept: */*\r\n\
Content-Length: 181\r\n\
Content-Length: {}\r\n\
Content-Type: multipart/form-data; boundary=--[..]\r\n\
\r\n\
--[..]\r\n\
Expand All @@ -67,7 +81,8 @@ fn buffer() {
\r\n\
1234\r\n\
--[..]\r\n",
);
multipart_boundary_size() + 45
));
s.send("HTTP/1.1 200 OK\r\n\r\n");

let mut handle = handle();
Expand All @@ -82,6 +97,7 @@ fn buffer() {
t!(handle.perform());
}

#[cfg(feature = "static-curl")]
#[test]
fn file() {
let s = Server::new();
Expand All @@ -102,7 +118,7 @@ fn file() {
{}\
\r\n\
--[..]\r\n",
199 + formdata.len(),
multipart_boundary_size() + 63 + formdata.len(),
formdata
)
.as_str(),
Expand Down

0 comments on commit de57280

Please sign in to comment.