Skip to content

Commit

Permalink
Set negative value to request_content_len if can't unwrap contet_len
Browse files Browse the repository at this point in the history
  • Loading branch information
ysak-y committed Oct 28, 2023
1 parent ae78939 commit 9bd5ba6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/http/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub struct EspHttpConnection {
follow_redirects_policy: FollowRedirectsPolicy,
event_handler: Box<Option<Box<dyn Fn(&esp_http_client_event_t) -> esp_err_t>>>,
state: State,
request_content_len: u64,
request_content_len: i64,
follow_redirects: bool,
headers: BTreeMap<Uncased<'static>, String>,
content_len_header: UnsafeCell<Option<Option<String>>>,
Expand Down Expand Up @@ -246,7 +246,7 @@ impl EspHttpConnection {
_ => false,
};

self.request_content_len = content_len.unwrap_or(0);
self.request_content_len = content_len.unwrap_or(-1);

esp!(unsafe { esp_http_client_open(self.raw_client, self.request_content_len as _) })?;

Expand Down

0 comments on commit 9bd5ba6

Please sign in to comment.