Skip to content

Commit 85d5994

Browse files
committed
Update curl submodule
Closes #210
1 parent 55a36b4 commit 85d5994

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

curl-sys/curl

Submodule curl updated 1260 files

curl-sys/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,8 @@ pub const CURLVERSION_FIRST: CURLversion = 0;
813813
pub const CURLVERSION_SECOND: CURLversion = 1;
814814
pub const CURLVERSION_THIRD: CURLversion = 2;
815815
pub const CURLVERSION_FOURTH: CURLversion = 3;
816-
pub const CURLVERSION_NOW: CURLversion = CURLVERSION_FOURTH;
816+
pub const CURLVERSION_FIFTH: CURLversion = 4;
817+
pub const CURLVERSION_NOW: CURLversion = CURLVERSION_FIFTH;
817818

818819
#[repr(C)]
819820
pub struct curl_version_info_data {
@@ -831,6 +832,8 @@ pub struct curl_version_info_data {
831832
pub libidn: *const c_char,
832833
pub iconv_ver_num: c_int,
833834
pub libssh_version: *const c_char,
835+
pub brotli_ver_num: c_uint,
836+
pub brotli_version: *const c_char,
834837
}
835838

836839
pub const CURL_VERSION_IPV6: c_int = 1 << 0;

src/version.rs

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl Version {
180180
/// against.
181181
pub fn ares_version(&self) -> Option<&str> {
182182
unsafe {
183-
if (*self.inner).age >= 1 {
183+
if (*self.inner).age >= curl_sys::CURLVERSION_SECOND {
184184
::opt_str((*self.inner).ares)
185185
} else {
186186
None
@@ -191,7 +191,7 @@ impl Version {
191191
/// If available, the version of ares that libcurl is linked against.
192192
pub fn ares_version_num(&self) -> Option<u32> {
193193
unsafe {
194-
if (*self.inner).age >= 1 {
194+
if (*self.inner).age >= curl_sys::CURLVERSION_SECOND {
195195
Some((*self.inner).ares_num as u32)
196196
} else {
197197
None
@@ -202,7 +202,7 @@ impl Version {
202202
/// If available, the version of libidn that libcurl is linked against.
203203
pub fn libidn_version(&self) -> Option<&str> {
204204
unsafe {
205-
if (*self.inner).age >= 2 {
205+
if (*self.inner).age >= curl_sys::CURLVERSION_THIRD {
206206
::opt_str((*self.inner).libidn)
207207
} else {
208208
None
@@ -213,7 +213,7 @@ impl Version {
213213
/// If available, the version of iconv libcurl is linked against.
214214
pub fn iconv_version_num(&self) -> Option<u32> {
215215
unsafe {
216-
if (*self.inner).age >= 3 {
216+
if (*self.inner).age >= curl_sys::CURLVERSION_FOURTH {
217217
Some((*self.inner).iconv_ver_num as u32)
218218
} else {
219219
None
@@ -224,13 +224,35 @@ impl Version {
224224
/// If available, the version of iconv libcurl is linked against.
225225
pub fn libssh_version(&self) -> Option<&str> {
226226
unsafe {
227-
if (*self.inner).age >= 3 {
227+
if (*self.inner).age >= curl_sys::CURLVERSION_FOURTH {
228228
::opt_str((*self.inner).libssh_version)
229229
} else {
230230
None
231231
}
232232
}
233233
}
234+
235+
/// If available, the version of brotli libcurl is linked against.
236+
pub fn brotli_version_num(&self) -> Option<u32> {
237+
unsafe {
238+
if (*self.inner).age >= curl_sys::CURLVERSION_FIFTH {
239+
Some((*self.inner).brotli_ver_num)
240+
} else {
241+
None
242+
}
243+
}
244+
}
245+
246+
/// If available, the version of brotli libcurl is linked against.
247+
pub fn brotli_version(&self) -> Option<&str> {
248+
unsafe {
249+
if (*self.inner).age >= curl_sys::CURLVERSION_FIFTH {
250+
::opt_str((*self.inner).brotli_version)
251+
} else {
252+
None
253+
}
254+
}
255+
}
234256
}
235257

236258
impl fmt::Debug for Version {

tests/post.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ POST / HTTP/1.1\r\n\
2929
Host: 127.0.0.1:$PORT\r\n\
3030
Accept: */*\r\n\
3131
Content-Length: 142\r\n\
32-
Expect: 100-continue\r\n\
3332
Content-Type: multipart/form-data; boundary=--[..]\r\n\
3433
\r\n\
3534
--[..]\r\n\
@@ -55,7 +54,6 @@ POST / HTTP/1.1\r\n\
5554
Host: 127.0.0.1:$PORT\r\n\
5655
Accept: */*\r\n\
5756
Content-Length: 181\r\n\
58-
Expect: 100-continue\r\n\
5957
Content-Type: multipart/form-data; boundary=--[..]\r\n\
6058
\r\n\
6159
--[..]\r\n\
@@ -86,7 +84,6 @@ POST / HTTP/1.1\r\n\
8684
Host: 127.0.0.1:$PORT\r\n\
8785
Accept: */*\r\n\
8886
Content-Length: {}\r\n\
89-
Expect: 100-continue\r\n\
9087
Content-Type: multipart/form-data; boundary=--[..]\r\n\
9188
\r\n\
9289
--[..]\r\n\

0 commit comments

Comments
 (0)