MCPcopy Create free account
hub / github.com/amule-project/amule / GetSecureWaitStartTime

Method GetSecureWaitStartTime

src/ClientCredits.cpp:234–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232
233
234uint64 CClientCredits::GetSecureWaitStartTime(uint32 dwForIP)
235{
236 if (m_dwUnSecureWaitTime == 0 || m_dwSecureWaitTime == 0)
237 SetSecWaitStartTime(dwForIP);
238
239 if (m_pCredits->nKeySize != 0){ // this client is a SecureHash Client
240 if (GetCurrentIdentState(dwForIP) == IS_IDENTIFIED){ // good boy
241 return m_dwSecureWaitTime;
242 }
243 else{ // not so good boy
244 if (dwForIP == m_dwWaitTimeIP){
245 return m_dwUnSecureWaitTime;
246 }
247 else{ // bad boy
248 // this can also happen if the client has not identified himself yet, but will do later - so maybe he is not a bad boy :) .
249
250 m_dwUnSecureWaitTime = ::GetTickCount64();
251 m_dwWaitTimeIP = dwForIP;
252 return m_dwUnSecureWaitTime;
253 }
254 }
255 }
256 else{ // not a SecureHash Client - handle it like before for now (no security checks)
257 return m_dwUnSecureWaitTime;
258 }
259}
260
261
262void CClientCredits::SetSecWaitStartTime(uint32 dwForIP)

Callers 1

GetWaitStartTimeMethod · 0.80

Calls 1

GetTickCount64Function · 0.85

Tested by

no test coverage detected