Commit 79ab26ff authored by TousakaRin's avatar TousakaRin

fix code style, make the logic clearer

parent 89f462d1
......@@ -764,18 +764,10 @@ void Controller::Call::OnComplete(Controller* c, int error_code/*note*/,
c->stream_creator()->CleanupSocketForStream(
sending_sock.get(), c, error_code);
}
if (enable_circuit_breaker) {
if (!sending_sock) {
SocketUniquePtr sock;
if (Socket::Address(peer_id, &sock) == 0) {
sock->FeedbackCircuitBreaker(error_code,
butil::gettimeofday_us() - begin_time_us);
}
} else {
if (enable_circuit_breaker && sending_sock) {
sending_sock->FeedbackCircuitBreaker(error_code,
butil::gettimeofday_us() - begin_time_us);
}
}
// Release the `Socket' we used to send/receive data
sending_sock.reset(NULL);
......
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