MCPcopy Create free account
hub / github.com/apache/brpc / SetAuthentication

Method SetAuthentication

src/brpc/socket.cpp:2146–2159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2144}
2145
2146void Socket::SetAuthentication(int error_code) {
2147 uint64_t expected = 0;
2148 // `bthread_id_destroy' has release fence to prevent this CAS being
2149 // reordered after it.
2150 if (_auth_flag_error.compare_exchange_strong(
2151 expected, (AUTH_FLAG | error_code),
2152 butil::memory_order_relaxed)) {
2153 // As expected
2154 if (error_code != 0) {
2155 SetFailed(error_code, "Fail to authenticate %s", description().c_str());
2156 }
2157 CHECK_EQ(0, bthread_id_unlock_and_destroy(_auth_id));
2158 }
2159}
2160
2161AuthContext* Socket::mutable_auth_context() {
2162 if (_auth_context != NULL) {

Callers 3

auth_fighterFunction · 0.80
ProcessNewMessageMethod · 0.80
IssueRPCMethod · 0.80

Calls 3

c_strMethod · 0.45

Tested by 1

auth_fighterFunction · 0.64