Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions curl-sys/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ pub const CURLOPT_SSL_OPTIONS: CURLoption = CURLOPTTYPE_LONG + 216;
// pub const CURLOPT_DNS_LOCAL_IP6: CURLoption = CURLOPTTYPE_OBJECTPOINT + 223;
// pub const CURLOPT_LOGIN_OPTIONS: CURLoption = CURLOPTTYPE_OBJECTPOINT + 224;
pub const CURLOPT_EXPECT_100_TIMEOUT_MS: CURLoption = CURLOPTTYPE_LONG + 227;
pub const CURLOPT_PROXYHEADER: CURLoption = CURLOPTTYPE_OBJECTPOINT + 228;
pub const CURLOPT_PINNEDPUBLICKEY: CURLoption = CURLOPTTYPE_OBJECTPOINT + 230;
pub const CURLOPT_UNIX_SOCKET_PATH: CURLoption = CURLOPTTYPE_OBJECTPOINT + 231;
pub const CURLOPT_PATH_AS_IS: CURLoption = CURLOPTTYPE_LONG + 234;
Expand Down
5 changes: 5 additions & 0 deletions src/easy/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,11 @@ impl Easy {
self.inner.http_headers(list)
}

/// Same as [`Easy2::proxy_headers`](struct.Easy2.html#method.proxy_headers)
pub fn proxy_headers(&mut self, list: List) -> Result<(), Error> {
self.inner.proxy_headers(list)
}

/// Same as [`Easy2::cookie`](struct.Easy2.html#method.cookie)
pub fn cookie(&mut self, cookie: &str) -> Result<(), Error> {
self.inner.cookie(cookie)
Expand Down
22 changes: 13 additions & 9 deletions src/easy/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ struct Inner<H> {
header_list: Option<List>,
resolve_list: Option<List>,
connect_to_list: Option<List>,
proxy_header_list: Option<List>,
form: Option<Form>,
error_buf: RefCell<Vec<u8>>,
handler: H,
Expand Down Expand Up @@ -594,6 +595,7 @@ impl<H: Handler> Easy2<H> {
header_list: None,
resolve_list: None,
connect_to_list: None,
proxy_header_list: None,
form: None,
error_buf: RefCell::new(vec![0; curl_sys::CURL_ERROR_SIZE]),
handler,
Expand Down Expand Up @@ -1593,15 +1595,17 @@ impl<H> Easy2<H> {
self.setopt_ptr(curl_sys::CURLOPT_HTTPHEADER, ptr as *const _)
}

// /// Add some headers to send to the HTTP proxy.
// ///
// /// This function is essentially the same as `http_headers`.
// ///
// /// By default this option is not set and corresponds to
// /// `CURLOPT_PROXYHEADER`
// pub fn proxy_headers(&mut self, list: &'a List) -> Result<(), Error> {
// self.setopt_ptr(curl_sys::CURLOPT_PROXYHEADER, list.raw as *const _)
// }
/// Add some headers to send to the HTTP proxy.
///
/// This function is essentially the same as `http_headers`.
///
/// By default this option is not set and corresponds to
/// `CURLOPT_PROXYHEADER`
pub fn proxy_headers(&mut self, list: List) -> Result<(), Error> {
let ptr = list::raw(&list);
self.inner.proxy_header_list = Some(list);
self.setopt_ptr(curl_sys::CURLOPT_PROXYHEADER, ptr as *const _)
}

/// Set the contents of the HTTP Cookie header.
///
Expand Down
Loading