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

Function auth_fighter

test/brpc_socket_unittest.cpp:150–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148const int AUTH_ERR = -9;
149
150void* auth_fighter(void* arg) {
151 bthread_usleep(10000);
152 int auth_error = 0;
153 brpc::Socket* s = (brpc::Socket*)arg;
154 if (s->FightAuthentication(&auth_error) == 0) {
155 winner_count.fetch_add(1);
156 s->SetAuthentication(AUTH_ERR);
157 } else {
158 EXPECT_EQ(AUTH_ERR, auth_error);
159 }
160 return NULL;
161}
162
163TEST_F(SocketTest, authentication) {
164 brpc::SocketId id;

Callers

nothing calls this directly

Calls 4

bthread_usleepFunction · 0.85
FightAuthenticationMethod · 0.80
fetch_addMethod · 0.80
SetAuthenticationMethod · 0.80

Tested by

no test coverage detected