Skip to content
Merged
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
6 changes: 3 additions & 3 deletions src/connmgr/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3214,9 +3214,9 @@ pub mod tests {
#[cfg(debug_assertions)]
#[test]
fn test_task_sizes() {
// Sizes in debug mode at commit 6b636f8842149e351dd3c29a5d133737e2a8fdef
const REQ_TASK_SIZE_BASE: usize = 6888;
const STREAM_TASK_SIZE_BASE: usize = 13224;
// Sizes in debug mode at commit TBD
const REQ_TASK_SIZE_BASE: usize = 7064;
const STREAM_TASK_SIZE_BASE: usize = 15744;

// Cause tests to fail if sizes grow too much
const GROWTH_LIMIT: usize = 1000;
Expand Down
20 changes: 11 additions & 9 deletions src/connmgr/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4539,6 +4539,8 @@ where
let stream = RefCell::new(stream);
let req = client::Request::new(io_split(&stream), buf1, buf2);

let mut headers = ArrayVec::<http1::Header, HEADERS_MAX>::new();

let req_header = {
let rdata = match &zreq.ptype {
zhttppacket::RequestPacket::Data(data) => data,
Expand All @@ -4547,8 +4549,6 @@ where

let host_port = &url[url::Position::BeforeHost..url::Position::AfterPort];

let mut headers = ArrayVec::<http1::Header, HEADERS_MAX>::new();

headers.push(http1::Header {
name: "Host",
value: host_port.as_bytes(),
Expand Down Expand Up @@ -5002,7 +5002,11 @@ where

let req = client::Request::new(io_split(&stream), buf1, buf2);

let (req_header, ws_key, overflow) = {
let mut ws_key = None;
let mut ws_ext = ArrayVec::<u8, 512>::new();
let mut headers = ArrayVec::<http1::Header, HEADERS_MAX>::new();

let (req_header, overflow) = {
let rdata = match &zreq.ptype {
zhttppacket::RequestPacket::Data(data) => data,
_ => return Err(Error::BadRequest),
Expand All @@ -5012,16 +5016,14 @@ where

let host_port = &url[url::Position::BeforeHost..url::Position::AfterPort];

let ws_key = if websocket { Some(gen_ws_key()) } else { None };
if websocket {
ws_key = Some(gen_ws_key());
}

if !websocket && rdata.more {
follow_redirects = false;
}

let mut ws_ext = ArrayVec::<u8, 512>::new();

let mut headers = ArrayVec::<http1::Header, HEADERS_MAX>::new();

headers.push(http1::Header {
name: "Host",
value: host_port.as_bytes(),
Expand Down Expand Up @@ -5152,7 +5154,7 @@ where
req.prepare_header(method, path, &headers, body_size, false, initial_body, end)?
};

(req_header, ws_key, overflow)
(req_header, overflow)
};

// Send request header
Expand Down
Loading
Loading