Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit 1d3d703

Browse files
committed
Upgrate to latest rust-http2
1 parent d4691d0 commit 1d3d703

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1181
-432
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
run: "./ci/install-protobuf.sh"
136136
shell: bash
137137
- name: install protobuf-codegen
138-
run: cargo install protobuf-codegen --version=2.18.2
138+
run: cargo install protobuf-codegen --version=2.23
139139
shell: bash
140140
- name: gen
141141
run: grpc-compiler/test-protoc-plugin/gen.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ In Cargo.toml:
6363
```ini
6464
[dependencies]
6565
grpc = "~0.8"
66-
protobuf = "~2"
66+
protobuf = "2.23"
6767
futures = "~0.3"
6868

6969
[build-dependencies]

ci-gen/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn test_protoc_plugin_job() -> Job {
7373
steps.push(install_protobuf_step());
7474
steps.push(Step::run(
7575
"install protobuf-codegen",
76-
"cargo install protobuf-codegen --version=2.18.2",
76+
"cargo install protobuf-codegen --version=2.23",
7777
));
7878
steps.push(Step::run("gen", "grpc-compiler/test-protoc-plugin/gen.sh"));
7979
steps.push(Step::run(

grpc-compiler/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ authors = ["Stepan Koltsov <[email protected]>"]
77
edition = "2018"
88

99
[dependencies]
10-
protobuf = "~2.18.2"
11-
protobuf-codegen = "~2.18.2"
10+
protobuf = "2.23"
11+
protobuf-codegen = "2.23"
1212

1313
[[bin]]
1414

grpc-compiler/src/codegen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ impl<'a> MethodGen<'a> {
295295

296296
fn server_sig(&self) -> String {
297297
format!(
298-
"{}(&self, o: ::grpc::ServerHandlerContext, req: {}, resp: {}) -> ::grpc::Result<()>",
298+
"{}(&self, req: {}, resp: {}) -> ::grpc::Result<()>",
299299
self.snake_name(),
300300
self.server_req_type(),
301301
self.server_resp_type(),
@@ -492,7 +492,7 @@ impl<'a> ServiceGen<'a> {
492492
method.write_descriptor(w, "::grpc::rt::ArcOrStatic::Static(&", "),");
493493
w.block("{", "},", |w| {
494494
w.write_line(&format!("let handler_copy = {}.clone();", handler));
495-
w.write_line(&format!("::grpc::rt::MethodHandler{}::new(move |ctx, req, resp| (*handler_copy).{}(ctx, req, resp))",
495+
w.write_line(&format!("::grpc::rt::MethodHandler{}::new(move |req, resp| (*handler_copy).{}(req, resp))",
496496
method.streaming_upper(),
497497
method.snake_name()));
498498
});

grpc-compiler/test-protoc-plugin/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ publish = false
66
edition = "2018"
77

88
[dependencies]
9-
tls-api = "0.4.*"
10-
protobuf = "~2.18.2"
9+
tls-api = "0.5.0"
10+
protobuf = "2.23"
1111
grpc = { path = "../../grpc" }
1212
grpc-protobuf = { path = "../../grpc-protobuf" }
1313

grpc-examples/greeter/Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ path = "../../grpc"
1515
path = "../../grpc-protobuf"
1616

1717
[dependencies]
18-
protobuf = "~2.18.2"
18+
protobuf = "2.23"
1919
futures = "0.3.*"
20-
tls-api = "0.4.*"
21-
tls-api-native-tls = "0.4.*"
22-
httpbis = "~0.9"
23-
#httpbis = { git = "https://github.com/stepancheg/rust-http2" }
20+
tls-api = "0.5.0"
21+
tls-api-stub = "0.5.0"
22+
tls-api-native-tls = "0.5.0"
23+
#httpbis = "~0.9"
24+
httpbis = { git = "https://github.com/stepancheg/rust-http2" }
25+
#httpbis = { path = "../../../rust-http2/httpbis" }
2426
env_logger = "~0.5"
2527

2628
[build-dependencies]

grpc-examples/greeter/src/bin/greeter_client.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use tls_api::TlsConnectorBuilder;
1313

1414
fn test_tls_connector() -> tls_api_native_tls::TlsConnector {
1515
let root_ca = include_bytes!("../root-ca.der");
16-
let root_ca = tls_api::Certificate::from_der(root_ca.to_vec());
1716

1817
let mut builder = tls_api_native_tls::TlsConnector::builder().unwrap();
1918
builder
@@ -45,8 +44,10 @@ fn main() {
4544
// This is a bit complicated, because we need to explicitly pass root CA here
4645
// because server uses self-signed certificate.
4746
// TODO: simplify it
48-
let tls_option =
49-
httpbis::ClientTlsOption::Tls("foobar.com".to_owned(), Arc::new(test_tls_connector()));
47+
let tls_option = httpbis::ClientTlsOption::Tls(
48+
"foobar.com".to_owned(),
49+
Arc::new(test_tls_connector().into_dyn()),
50+
);
5051
let grpc_client = Arc::new(
5152
grpc::ClientBuilder::new("::1", port)
5253
.explicit_tls(tls_option)

grpc-examples/greeter/src/bin/greeter_server.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@ use std::thread;
44
use grpc_examples_greeter::helloworld::*;
55
use grpc_examples_greeter::helloworld_grpc::*;
66

7-
use grpc::ServerHandlerContext;
87
use grpc::ServerRequestSingle;
98
use grpc::ServerResponseUnarySink;
9+
use tls_api::TlsAcceptor;
1010
use tls_api::TlsAcceptorBuilder;
1111

1212
struct GreeterImpl;
1313

1414
impl Greeter for GreeterImpl {
1515
fn say_hello(
1616
&self,
17-
_: ServerHandlerContext,
1817
req: ServerRequestSingle<HelloRequest>,
1918
resp: ServerResponseUnarySink<HelloReply>,
2019
) -> grpc::Result<()> {
@@ -32,7 +31,7 @@ impl Greeter for GreeterImpl {
3231

3332
fn test_tls_acceptor() -> tls_api_native_tls::TlsAcceptor {
3433
let pkcs12 = include_bytes!("../foobar.com.p12");
35-
let builder = tls_api_native_tls::TlsAcceptorBuilder::from_pkcs12(pkcs12, "mypass").unwrap();
34+
let builder = tls_api_native_tls::TlsAcceptor::builder_from_pkcs12(pkcs12, "mypass").unwrap();
3635
builder.build().unwrap()
3736
}
3837

grpc-examples/route_guide/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ path = "../../grpc"
1515
path = "../../grpc-protobuf"
1616

1717
[dependencies]
18-
protobuf = "~2.18.2"
18+
protobuf = "2.23"
1919
futures = "0.3.*"
20-
tls-api = "0.4.*"
21-
tls-api-native-tls = "0.4.*"
20+
tls-api = "0.5.0"
21+
tls-api-stub = "0.5.0"
2222
env_logger = "0.4.*"
2323
rand = "0.5.5"
2424
json = "0.11.*"

0 commit comments

Comments
 (0)