| 232 | |
| 233 | |
| 234 | uint64 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 | |
| 262 | void CClientCredits::SetSecWaitStartTime(uint32 dwForIP) |
no test coverage detected