Skip to content

Commit

Permalink
reproduce error
Browse files Browse the repository at this point in the history
Signed-off-by: tabokie <xy.tao@outlook.com>
  • Loading branch information
tabokie committed Jul 12, 2023
1 parent 0dd3e60 commit 04d7d56
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ jobs:
shell: cmd
- run: go version ; cargo version ; cmake --version
- run: cargo xtask submodule
- run: cargo build
- run: cargo build --no-default-features
- run: cargo build --no-default-features --features "protobuf-codec"
- run: cargo build --no-default-features --features "prost-codec"
- run: cargo test --all
- run: cargo test --features "nightly"

Expand Down
6 changes: 3 additions & 3 deletions src/call/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ impl RequestContext {

/// If the server binds in non-secure mode, this will return None
fn auth_context(&self) -> Option<AuthContext> {
#[cfg(feature = "_secure")]
// #[cfg(feature = "_secure")]
unsafe {
let call = grpc_sys::grpcwrap_request_call_context_get_call(self.ctx);
AuthContext::from_call_ptr(call)
}
#[cfg(not(feature = "_secure"))]
None
// #[cfg(not(feature = "_secure"))]
// None
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/security/auth_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::grpc_sys::{
/// identity (e.g. for client certificate authentication this property will be
/// `x509_common_name` or `x509_subject_alternative_name`).
pub struct AuthContext {
ctx: std::ptr::NonNull<grpc_auth_context>,
ctx: NonNull<grpc_auth_context>,
}

/// Binding to gRPC Core AuthContext
Expand Down
8 changes: 4 additions & 4 deletions src/security/mod.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.

#[cfg(feature = "_secure")]
// #[cfg(feature = "_secure")]
mod auth_context;
#[cfg(feature = "_secure")]
mod credentials;

use grpcio_sys::{grpc_channel_credentials, grpc_server_credentials};

#[cfg(feature = "_secure")]
// #[cfg(feature = "_secure")]
pub use self::auth_context::*;
#[cfg(not(feature = "_secure"))]
pub struct AuthContext;
// #[cfg(not(feature = "_secure"))]
// pub struct AuthContext;

#[cfg(feature = "_secure")]
pub use self::credentials::{
Expand Down

0 comments on commit 04d7d56

Please sign in to comment.