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

Auto-buffer HTTP connections when TLS is set up #43

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

bugadani
Copy link
Contributor

No description provided.

#[cfg(not(feature = "embedded-tls"))]
Tls(&'m mut T), // Variant is never actually created, but we need it to avoid "unused lifetime" warning
Tls((&'m mut (), core::convert::Infallible)), // Variant is impossible to create, but we need it to avoid "unused lifetime" warning
Copy link
Contributor Author

@bugadani bugadani Oct 17, 2023

Choose a reason for hiding this comment

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

interestingly, &'m mut Infallible isn't uninhabited, so branches using this variant wouldn't be unreachable.

Copy link
Member

@rmja rmja left a comment

Choose a reason for hiding this comment

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

Looks good to me, @lulf could you have a look?

))),
None => Ok(HttpConnection::Plain(conn)),
}
#[cfg(not(feature = "embedded-tls"))]
Ok(HttpConnection::Plain(conn))
Copy link
Member

Choose a reason for hiding this comment

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

Brilliant idea!

Copy link
Member

@lulf lulf left a comment

Choose a reason for hiding this comment

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

🚀🚀

@rmja rmja merged commit e167090 into drogue-iot:main Oct 18, 2023
1 check passed
@bugadani bugadani deleted the autobuffer branch October 18, 2023 08:38
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.

3 participants