Only retry idempotent requests. (#80)
This also reverts a change to send_body that was originally added to return the number of bytes written. It's no longer needed now that we check the size of the reader in advance. Fixes #76.
This commit is contained in:
committed by
GitHub
parent
15be014e05
commit
00461fb5bd
10
src/body.rs
10
src/body.rs
@@ -166,12 +166,12 @@ pub(crate) fn send_body(
|
||||
mut body: SizedReader,
|
||||
do_chunk: bool,
|
||||
stream: &mut Stream,
|
||||
) -> IoResult<u64> {
|
||||
let n = if do_chunk {
|
||||
copy_chunked(&mut body.reader, stream)?
|
||||
) -> IoResult<()> {
|
||||
if do_chunk {
|
||||
copy_chunked(&mut body.reader, stream)?;
|
||||
} else {
|
||||
copy(&mut body.reader, stream)?
|
||||
copy(&mut body.reader, stream)?;
|
||||
};
|
||||
|
||||
Ok(n)
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user