Commit 977892a3 authored by gejun's avatar gejun

Fix removed ControllerPrivateAccessor.connection_type()

parent 48dae6ce
......@@ -92,7 +92,7 @@ void PackEspRequest(butil::IOBuf* packet_buf,
const Authenticator* auth) {
ControllerPrivateAccessor accessor(cntl);
if (accessor.connection_type() == CONNECTION_TYPE_SINGLE) {
if (cntl->connection_type() == CONNECTION_TYPE_SINGLE) {
return cntl->SetFailed(
EINVAL, "esp protocol can't work with CONNECTION_TYPE_SINGLE");
}
......
......@@ -169,7 +169,7 @@ void PackNovaRequest(butil::IOBuf* buf,
const butil::IOBuf& request,
const Authenticator* /*not supported*/) {
ControllerPrivateAccessor accessor(controller);
if (accessor.connection_type() == CONNECTION_TYPE_SINGLE) {
if (controller->connection_type() == CONNECTION_TYPE_SINGLE) {
return controller->SetFailed(
EINVAL, "nova_pbrpc can't work with CONNECTION_TYPE_SINGLE");
}
......
......@@ -157,7 +157,7 @@ void PackNsheadMcpackRequest(butil::IOBuf* buf,
const butil::IOBuf& request,
const Authenticator* /*not supported*/) {
ControllerPrivateAccessor accessor(controller);
if (accessor.connection_type() == CONNECTION_TYPE_SINGLE) {
if (controller->connection_type() == CONNECTION_TYPE_SINGLE) {
return controller->SetFailed(
EINVAL, "nshead_mcpack can't work with CONNECTION_TYPE_SINGLE");
}
......
......@@ -399,7 +399,7 @@ void PackNsheadRequest(
const butil::IOBuf& request,
const Authenticator*) {
ControllerPrivateAccessor accessor(cntl);
if (accessor.connection_type() == CONNECTION_TYPE_SINGLE) {
if (cntl->connection_type() == CONNECTION_TYPE_SINGLE) {
return cntl->SetFailed(
EINVAL, "nshead protocol can't work with CONNECTION_TYPE_SINGLE");
}
......
......@@ -236,8 +236,7 @@ void PackPublicPbrpcRequest(butil::IOBuf* buf,
head->set_from_host(butil::ip2str(butil::my_ip()).c_str());
head->set_content_type(CONTENT_TYPE);
bool short_connection = (ControllerPrivateAccessor(controller)
.connection_type() == CONNECTION_TYPE_SHORT);
bool short_connection = (controller->connection_type() == CONNECTION_TYPE_SHORT);
head->set_connection(!short_connection);
head->set_charset(CHARSET);
char time_buf[128];
......
......@@ -726,7 +726,7 @@ void PackThriftRequest(
const butil::IOBuf& request,
const Authenticator*) {
ControllerPrivateAccessor accessor(cntl);
if (accessor.connection_type() == CONNECTION_TYPE_SINGLE) {
if (cntl->connection_type() == CONNECTION_TYPE_SINGLE) {
return cntl->SetFailed(
EINVAL, "thrift protocol can't work with CONNECTION_TYPE_SINGLE");
}
......
......@@ -541,7 +541,7 @@ void PackUbrpcRequest(butil::IOBuf* buf,
const butil::IOBuf& request,
const Authenticator* /*not supported*/) {
ControllerPrivateAccessor accessor(controller);
if (accessor.connection_type() == CONNECTION_TYPE_SINGLE) {
if (controller->connection_type() == CONNECTION_TYPE_SINGLE) {
return controller->SetFailed(
EINVAL, "ubrpc protocol can't work with CONNECTION_TYPE_SINGLE");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment