diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index 46ddc97..696d6ed 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -106,10 +106,11 @@ int tfe_proxy_fds_accept(struct tfe_proxy * ctx, int fd_downstream, int fd_upstr struct tfe_stream * stream = tfe_stream_create(ctx, worker_thread_ctx); enum tfe_stream_proto stream_protocol; - uint16_t __size; + uint8_t stream_protocol_in_char = 0; + uint16_t size = 0; - int result = tfe_cmsg_get_value(cmsg, TFE_CMSG_TCP_RESTORE_PROTOCOL, (unsigned char *)&stream_protocol, - sizeof(stream_protocol), &__size); + int result = tfe_cmsg_get_value(cmsg, TFE_CMSG_TCP_RESTORE_PROTOCOL, (unsigned char *)&stream_protocol_in_char, + sizeof(stream_protocol_in_char), &size); if (unlikely(result < 0)) { @@ -117,6 +118,7 @@ int tfe_proxy_fds_accept(struct tfe_proxy * ctx, int fd_downstream, int fd_upstr goto __errout; } + stream_protocol = (enum tfe_stream_proto)stream_protocol_in_char; tfe_stream_option_set(stream, TFE_STREAM_OPT_SESSION_TYPE, &stream_protocol, sizeof(stream_protocol)); tfe_stream_cmsg_setup(stream, cmsg); diff --git a/plugin/business/ssl-policy/src/ssl_policy.cpp b/plugin/business/ssl-policy/src/ssl_policy.cpp index 6921f31..ff414fe 100644 --- a/plugin/business/ssl-policy/src/ssl_policy.cpp +++ b/plugin/business/ssl-policy/src/ssl_policy.cpp @@ -214,7 +214,7 @@ enum ssl_stream_action ssl_policy_enforce(struct ssl_stream *upstream, void* u_p ret=ssl_stream_get_integer_opt(upstream, SSL_STREAM_OPT_IS_MUTUAL_AUTH, &is_mauth); ret=ssl_stream_get_integer_opt(upstream, SSL_STREAM_OPT_IS_CT_CERT, &is_ct); ret=ssl_stream_get_integer_opt(upstream, SSL_STREAM_OPT_HAS_PROTOCOL_ERRORS, &has_error); - assert(ret=0); + assert(ret==0); if( (pinning_staus==1 && param->bypass_pinning) || (is_mauth && param->bypass_mutual_auth) || (is_ev && param->bypass_ev_cert) ||