-
Notifications
You must be signed in to change notification settings - Fork 86
Exposing ServerConfig options #959
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
base: main
Are you sure you want to change the base?
Changes from 7 commits
9e2e063
6e9e0f1
49723bf
8637cde
264a1ef
9788f79
40ba009
d3bbf4c
737d45b
07b84de
a1609d8
7d0851d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
use serde::Deserialize; | ||
use serde::Serialize; | ||
use std::net::SocketAddr; | ||
use std::num::NonZeroU32; | ||
use std::path::PathBuf; | ||
|
||
/// Raw [`rustls::ServerConfig`] TLS configuration for use with | ||
|
@@ -49,6 +50,10 @@ pub struct ConfigDropshot { | |
pub bind_address: SocketAddr, | ||
/// maximum allowed size of a request body, defaults to 1024 | ||
pub request_body_max_bytes: usize, | ||
/// maximum size of any page of results | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wondered the same thing. Consumers can already do that if they want. It's kind of nice that the way it is now you can have your code break if we add some new config option so that you get a chance to look yourself at whether our default works for you. I think I've used this in the past. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't have to fix this here but I think I disagree with past-me here. If you want to do that, just check the changelog. We shouldn't need to bump a major to add new things. A builder interface would be nice, too. (I don't propose that we do anything in this PR.) |
||
pub page_max_nitems: NonZeroU32, | ||
/// default size for a page of results | ||
pub page_default_nitems: NonZeroU32, | ||
/// Default behavior for HTTP handler functions with respect to clients | ||
/// disconnecting early. | ||
pub default_handler_task_mode: HandlerTaskMode, | ||
|
@@ -106,6 +111,8 @@ impl Default for ConfigDropshot { | |
ConfigDropshot { | ||
bind_address: "127.0.0.1:0".parse().unwrap(), | ||
request_body_max_bytes: 1024, | ||
page_max_nitems: NonZeroU32::new(10000).unwrap(), | ||
page_default_nitems: NonZeroU32::new(100).unwrap(), | ||
default_handler_task_mode: HandlerTaskMode::Detached, | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.