Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
Signed-off-by: Zhang Bo <[email protected]>
  • Loading branch information
zhangbo1882 committed Jul 2, 2024
1 parent 0b3c0f6 commit 8ff9686
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
10 changes: 5 additions & 5 deletions api/envoy/service/tls_session_cache/v3/tls_session_cache.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ service TlsSessionCacheService {
}
}

enum Type {
enum TYPE {
// The request type to store a session to the cache.
STORE = 0;

Expand All @@ -26,7 +26,7 @@ enum Type {
}

message TlsSessionRequest {
Type type = 1;
TYPE type = 1;

// The TLS session id
string session_id = 2;
Expand All @@ -35,7 +35,7 @@ message TlsSessionRequest {
}

message TlsSessionResponse {
enum Code {
enum CODE {
// The response code to notify that the session id is added .
OK = 0;

Expand All @@ -46,9 +46,9 @@ message TlsSessionResponse {
NOT_FOUND = 2;
}

Type type = 1;
TYPE type = 1;

Code code = 2;
CODE code = 2;

string session_id = 3;

Expand Down
2 changes: 1 addition & 1 deletion source/common/tls/server_context_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
#include "source/common/runtime/runtime_features.h"
#include "source/common/stats/utility.h"
#include "source/common/tls/cert_validator/factory.h"
#include "source/common/tls/context_config_impl.h"
#include "source/common/tls/stats.h"
#include "source/common/tls/utility.h"

#include ""
#include "absl/container/node_hash_set.h"
#include "absl/strings/match.h"
#include "absl/strings/str_join.h"
Expand Down
3 changes: 0 additions & 3 deletions source/common/tls/session_cache/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_extension_package",
"envoy_package",
)

licenses(["notice"]) # Apache 2

envoy_package()

envoy_extension_package()

envoy_cc_library(
Expand Down
8 changes: 4 additions & 4 deletions source/common/tls/session_cache/session_cache_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ void GrpcClientImpl::onSuccess(
if (response->type() == envoy::service::tls_session_cache::v3::FETCH) {
// Copy the session data into the provided buffer.
switch (response->code()) {
case envoy::service::tls_session_cache::v3::TlsSessionResponse_Code_NOT_FOUND: {
case envoy::service::tls_session_cache::v3::TlsSessionResponse_CODE_NOT_FOUND: {
ENVOY_LOG(debug, "Session not found, set session cache index");
SSL_set_ex_data(ssl_, index_, static_cast<void*>(callbacks_));
break;
}
case envoy::service::tls_session_cache::v3::TlsSessionResponse_Code_OK: {
case envoy::service::tls_session_cache::v3::TlsSessionResponse_CODE_OK: {
ENVOY_LOG(debug, "fetching session succeed");
auto len = response->session_data().length();
if (len > 0) {
Expand Down Expand Up @@ -120,11 +120,11 @@ void GrpcClientImpl::onSuccess(
// The response is a STORE response, which means the session was successfully stored.
// Nothing to do here.
switch (response->code()) {
case envoy::service::tls_session_cache::v3::TlsSessionResponse_Code_OK: {
case envoy::service::tls_session_cache::v3::TlsSessionResponse_CODE_OK: {
ENVOY_LOG(debug, "Session stored successfully");
break;
}
case envoy::service::tls_session_cache::v3::TlsSessionResponse_Code_ALEADY_EXIST: {
case envoy::service::tls_session_cache::v3::TlsSessionResponse_CODE_ALEADY_EXIST: {
ENVOY_LOG(debug, "Session already exists");
break;
}
Expand Down

0 comments on commit 8ff9686

Please sign in to comment.