Would using Rust have prevented this?
Isn't this already Rust?
We found a bug in the hyper HTTP library
31–40 of 97 posts
Re: We found a bug in the hyper HTTP library
#32Re: We found a bug in the hyper HTTP library
#33Re: We found a bug in the hyper HTTP library
#34So “fearless concurrency” still only happens when one just decides to not be afraid… :)
Re: We found a bug in the hyper HTTP library
#35This would have been flagged by Clippy lints `let_underscore_untyped` or `let_underscore_must_use`, which sadly are not enabled by default.
#[allow(clippy::let_underscore_untyped,clippy::let_underscore_must_use)]
let _ = self.poll_flush(cx)?;Re: We found a bug in the hyper HTTP library
#36Earlier quoted context omitted.
You're missing how rust works. The function is explicitly allowed to fail, which is why it returns a Result . They're using the function calls within for their side effects. The ? at the end of each line signals that the function will short-circuit return with an error if the function call fails, and only if it is successful it returns the actual value: they just don't care about this value, hence the let _ =. Basica…
What I am saying, is make another version of the function, which is explicitly not allowed to fail, if you want to use it in the loop.
Re: We found a bug in the hyper HTTP library
#37`curl --http1.1` sends `Connection: Close` so sender (hyper) must attempt to shutdown connection after sending whole body. Surely any network is slower than memory copy into socket kernel buffers, so it must reliably trigger condition "buffer flush can't be done in one go" and thus trigger early TCP shutdown.
Re: We found a bug in the hyper HTTP library
#38This would have been flagged by Clippy lints `let_underscore_untyped` or `let_underscore_must_use`, which sadly are not enabled by default.
Ehh, easy fix #[allow(clippy::let_underscore_untyped,clippy::let_underscore_must_use)] let _ = self.poll_flush(cx)?;
Re: We found a bug in the hyper HTTP library
#39This would have been flagged by Clippy lints `let_underscore_untyped` or `let_underscore_must_use`, which sadly are not enabled by default.
Ehh, easy fix #[allow(clippy::let_underscore_untyped,clippy::let_underscore_must_use)] let _ = self.poll_flush(cx)?;
Re: We found a bug in the hyper HTTP library
#40Earlier quoted context omitted.
Ehh, easy fix #[allow(clippy::let_underscore_untyped,clippy::let_underscore_must_use)] let _ = self.poll_flush(cx)?;
Yeah, but you must know about them and the possible bug first in order to allow them...