Skip to content

Commit

Permalink
Fix: Don't throw on streaming responses (#272)
Browse files Browse the repository at this point in the history
Don't attempt to track streaming response body size
  • Loading branch information
robert3005 authored and bulldozer-bot[bot] committed Nov 26, 2019
1 parent e9d9f7d commit dfd76d2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions verification-http-server/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ impl SyncHandler {
return;
}
Body::Fixed(bytes) => {
response_size.store(bytes.len(), Ordering::SeqCst);
let mut response = hyper::Response::new(hyper::Body::from(bytes));
*response.status_mut() = raw_response.status;
*response.headers_mut() = raw_response.headers;
Expand Down Expand Up @@ -344,12 +343,8 @@ impl SyncHandler {
response_size.store(bytes.len(), Ordering::SeqCst);
Body::Fixed(bytes)
}
Body::Streaming(_write_body) =>
unimplemented!()
// Body::Streaming(Box::new(SizeTrackingWriteBody {
// write_body: write_body,
// response_size: response_size.clone(),
// })),
// handle tracking response_size for streaming body
Body::Streaming(write_body) => Body::Streaming(write_body),
};

response
Expand Down

0 comments on commit dfd76d2

Please sign in to comment.