-
Notifications
You must be signed in to change notification settings - Fork 29
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
Support for custom TLS port + optional verify peer #37
base: master
Are you sure you want to change the base?
Conversation
This allows `WindowSize`s to be compared for equality against `i32`s transparently...
… size methods There is no point in coercing the internal `WindowSize` struct into an `i32` before returning it; in fact, this can easily be done by clients if they have such a requirement.
This commit adds two methods to the `Session` trait that allow it to be notified when a new WINDOW_UPDATE frame signals an increase in the outbound window size for both the connection-level, as well as the stream-level windows.
Two new methods are added to the `Session` trait that allow it to receive notice when either the connection-level or a stream-level inbound window size decreases. These calls will, as a rule, always be emitted in pairs by the `HttpConnection` upon parsing a flow-control subject frame (at the moment this is only the DATA frame, as per the HTTP/2 spec).
The state now has an entry per stream, instead of storing just the raw stream. This is in preparation for extending the state to be able to track more stream-related information, that does not belong on the Stream trait itself. (The Stream trait is supposed to be the bridge between the session and its client that is interested only in stream-level events; requiring those clients to also implement tracking various book-keeping stream state is not only redundant---all streams will need to track the same state in the same way---but also not in line with what the Stream trait is supposed to represent.)
The method is used to signal errors that the local peer detects, in contrast to those that the remote signals by sending an RST_STREAM frame. The Session should send the RST_STREAM after the `on_stream_error` is called.
The mod.rs file was getting quite large...
The WindowUpdateStrategy trait is used to define the algorithm for updating the flow control window of both the connection, as well as individual stream. The object is provided the new size of the corresponding window and is expected to produce an action to be taken immediately: either increase the size of the window or do nothing.
src/http/client/tls.rs
Outdated
context: Http2TlsContext::Wrapped(context), | ||
} | ||
} | ||
|
||
/// Builds up a default `SslContext` instance wth TLS settings that the | ||
/// HTTP/2 spec mandates. The path to the CA file needs to be provided. | ||
pub fn build_default_context(ca_file_path: &Path) -> Result<SslContext, TlsConnectError> { | ||
pub fn build_default_context(ca_file_path: &Path, verify_peer : bool, cert_file: Option<PathBuf>, private_key: Option<PathBuf>) -> Result<SslContext, TlsConnectError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was meant to be a default context, which would be sensible without requiring the user to figure out what various switches do. That said, I'm not opposed to having a helper that offers more customization, without callers having to figure out how to build raw SslContext
s.
Would you mind renaming this method to something like build_context
and then implementing the original build_default_context
in terms of that?
Thanks for the PR! This seems like a few definite quality of life improvements. I just had one minor comment, that'd be great if you could address. |
@mlalic thanks. I have addressed the review comments. Let me know if you recommend any other changes. |
Flow ctrl Support
I have added support for following two features.