Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): ignore expect-continue with no body in debug mode #1983

Merged
merged 1 commit into from Oct 18, 2019

Conversation

seanmonstar
Copy link
Member

Closes #1843

@seanmonstar seanmonstar merged commit ca5836f into master Oct 18, 2019
@@ -151,7 +151,9 @@ where I: AsyncRead + AsyncWrite + Unpin,
self.state.version = msg.head.version;

if msg.decode == DecodedLength::ZERO {
debug_assert!(!msg.expect_continue, "expect-continue needs a body");
if log_enabled!(log::Level::Debug) && msg.expect_continue {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log_enabled! here doesn't seem necessary, since there's no expensive computation going on in the block.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True... I guess with max-log-level features, it could then just be eliminated... But I guess LLVM would also be able to eliminate if some_bool { /* nothing */ }. 🤷‍♂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah empty if blocks will go away.

@seanmonstar seanmonstar deleted the server-expect-continue-no-body branch October 18, 2019 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

server debug panic on Expect: 100-continue without Content-Length
2 participants