MCPcopy Create free account
hub / github.com/acl-dev/acl / get

Method get

lib_acl_cpp/independent/connpool/src/connect_manager.cpp:148–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148connect_pool* connect_manager::get(const char* addr,
149 bool exclusive /* = true */)
150{
151 char key[256];
152 lowercase(addr, key, sizeof(key));
153
154 if (exclusive)
155 lock_->lock();
156
157 std::vector<connect_pool*>::iterator it = pools_.begin();
158 for (; it != pools_.end(); ++it)
159 {
160 if (strcasecmp(key, (*it)->get_addr()) == 0)
161 {
162 if (exclusive)
163 lock_->unlock();
164 return *it;
165 }
166 }
167
168 if (exclusive)
169 lock_->unlock();
170
171 return NULL;
172}
173
174//////////////////////////////////////////////////////////////////////////
175

Callers

nothing calls this directly

Calls 6

beginMethod · 0.80
lowercaseFunction · 0.70
lockMethod · 0.45
endMethod · 0.45
get_addrMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected