Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b57c3f3
upgrade to hyper v1
seanmonstar Jun 4, 2024
6e05fb7
remove ResponseBody alias
seanmonstar Jun 7, 2024
da17e4c
remove unused line
seanmonstar Jun 7, 2024
96c093e
remove commented out lines
seanmonstar Jun 10, 2024
0140ee8
add a doc to Body
seanmonstar Jun 10, 2024
12eb307
remove more commented out old code
seanmonstar Jun 10, 2024
437f9f8
add comment about TcpListener::from_std
seanmonstar Jun 10, 2024
57789e0
stick to hyper 1.3
seanmonstar Jun 10, 2024
52c532a
test_util returns dropshot::Body
seanmonstar Jun 10, 2024
c7c2339
revert docs text about RequestInfo
seanmonstar Jun 14, 2024
d222073
consolidate into a single read_bytes function
seanmonstar Jun 14, 2024
009b864
remove commented out assertion
seanmonstar Jun 14, 2024
806be59
remove unused Service<&TlsConn>
seanmonstar Jun 14, 2024
8b9ca26
re-add WebsocketConnectionRaw
seanmonstar Jun 14, 2024
79a92f4
fmt
seanmonstar Jun 14, 2024
41deb68
change Body::full to Body::with_content
seanmonstar Jun 14, 2024
e4fa983
handle tcp accept errors like hyper used to
seanmonstar Jun 14, 2024
31144df
add comments about graceful shutdown
seanmonstar Jun 14, 2024
02f7619
add some breaking changes to changelog
seanmonstar Jun 17, 2024
e3f249c
update CHANGELOG.adoc
davepacheco Jun 21, 2024
b386977
Update dropshot/src/server.rs
seanmonstar Jun 21, 2024
21f0aa0
remove possiblity of error from tcp accept
seanmonstar Jun 21, 2024
796918e
add HttpAcceptor unit test
seanmonstar Jun 24, 2024
209afa2
bump lockfile
seanmonstar Jun 26, 2024
4e89c0a
bless newer trybuild output
seanmonstar Jun 28, 2024
78310b4
use 127.0.0.1 in acceptor tests, to make windows happy
seanmonstar Jun 28, 2024
9075a2a
Merge branch 'main' into hyper-v1-2.4-own-body
ahl Aug 21, 2024
557a262
Merge branch 'main' into hyper-v1-2.4-own-body
ahl Sep 26, 2024
6d0c5df
cargo.lock
ahl Sep 26, 2024
21769f2
fix changelog
ahl Sep 26, 2024
35c897b
update changelog again
ahl Sep 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@

https://github.com/oxidecomputer/dropshot/compare/v0.11.0\...HEAD[Full list of commits]

=== Breaking Changes

* https://github.com/oxidecomputer/dropshot/pull/1028[#1028] Updates Dropshot for `hyper` 1.0 and `http` 1.0. Since consumers provide Dropshot with values from `hyper` and `http`, you'll need to update to `hyper` 1.0 and `http` 1.0 (or newer compatible versions), too.

==== Upgrading to hyper 1.0

1. Update your crate's dependencies on `hyper` and `http` to 1.0 (or a newer compatible version) in Cargo.toml.
2. Replace any references to `hyper::Body` with `dropshot::Body` instead.
3. You may need to update your use of `dropshot::Body`; the `http-body-util` can be helpful.

There are no other known breaking changes in these crates that affect Dropshot. If you have any trouble with this upgrade, please let us know by filing an issue.

== 0.11.0 (released 2024-08-21)

https://github.com/oxidecomputer/dropshot/compare/v0.10.1\...v0.11.0[Full list of commits]
Expand Down
99 changes: 55 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions dropshot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ debug-ignore = "1.0.5"
form_urlencoded = "1.2.1"
futures = "0.3.30"
hostname = "0.4.0"
http = "0.2.9"
http = "1.1.0"
http-body-util = "0.1.2"
indexmap = "2.5.0"
multer = "3.1.0"
paste = "1.0.15"
Expand Down Expand Up @@ -55,7 +56,11 @@ version = "^0.11.1-dev"
path = "../dropshot_endpoint"

[dependencies.hyper]
version = "0.14"
version = "1.4.1"
features = [ "full" ]

[dependencies.hyper-util]
version = "0.1.9"
features = [ "full" ]

[dependencies.openapiv3]
Expand Down Expand Up @@ -88,8 +93,8 @@ anyhow = "1.0.89"
async-channel = "2.3.1"
buf-list = "1.0.3"
expectorate = "1.1.0"
hyper-rustls = "0.25.0"
hyper-staticfile = "0.9"
hyper-rustls = "0.26.0"
hyper-staticfile = "0.10"
lazy_static = "1.5.0"
libc = "0.2.158"
mime_guess = "2.0.5"
Expand Down
10 changes: 7 additions & 3 deletions dropshot/examples/file_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
//! Example using Dropshot to serve files

use dropshot::ApiDescription;
use dropshot::Body;
use dropshot::ConfigLogging;
use dropshot::ConfigLoggingLevel;
use dropshot::HttpError;
use dropshot::HttpServerStarter;
use dropshot::RequestContext;
use dropshot::{endpoint, Path};
use http::{Response, StatusCode};
use hyper::Body;
use schemars::JsonSchema;
use serde::Deserialize;
use std::path::PathBuf;
Expand Down Expand Up @@ -133,7 +133,11 @@ async fn static_content(
format!("failed to read file {:?}: {:#}", entry, e),
)
})?;
let file_stream = hyper_staticfile::FileBytesStream::new(file);

let file_access = hyper_staticfile::vfs::TokioFileAccess::new(file);
let file_stream =
hyper_staticfile::util::FileBytesStream::new(file_access);
let body = Body::wrap(hyper_staticfile::Body::Full(file_stream));

// Derive the MIME type from the file name
let content_type = mime_guess::from_path(&entry)
Expand All @@ -143,7 +147,7 @@ async fn static_content(
Ok(Response::builder()
.status(StatusCode::OK)
.header(http::header::CONTENT_TYPE, content_type)
.body(file_stream.into_body())?)
.body(body)?)
}
}

Expand Down
2 changes: 1 addition & 1 deletion dropshot/examples/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//! Example use of Dropshot for matching wildcard paths to serve static content.

use dropshot::ApiDescription;
use dropshot::Body;
use dropshot::ConfigDropshot;
use dropshot::ConfigLogging;
use dropshot::ConfigLoggingLevel;
Expand All @@ -10,7 +11,6 @@ use dropshot::HttpServerStarter;
use dropshot::RequestContext;
use dropshot::{endpoint, Path};
use http::{Response, StatusCode};
use hyper::Body;
use schemars::JsonSchema;
use serde::Deserialize;

Expand Down
2 changes: 1 addition & 1 deletion dropshot/examples/multipart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

use dropshot::endpoint;
use dropshot::ApiDescription;
use dropshot::Body;
use dropshot::ConfigDropshot;
use dropshot::ConfigLogging;
use dropshot::ConfigLoggingLevel;
Expand All @@ -11,7 +12,6 @@ use dropshot::HttpServerStarter;
use dropshot::MultipartBody;
use dropshot::RequestContext;
use http::{Response, StatusCode};
use hyper::Body;

#[tokio::main]
async fn main() -> Result<(), String> {
Expand Down
2 changes: 1 addition & 1 deletion dropshot/src/api_description.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1312,14 +1312,14 @@ mod test {
use crate::handler::RequestContext;
use crate::ApiDescription;
use crate::ApiEndpoint;
use crate::Body;
use crate::EndpointTagPolicy;
use crate::Path;
use crate::Query;
use crate::TagConfig;
use crate::TagDetails;
use crate::CONTENT_TYPE_JSON;
use http::Method;
use hyper::Body;
use hyper::Response;
use openapiv3::OpenAPI;
use schemars::JsonSchema;
Expand Down
Loading