| 317 | } |
| 318 | |
| 319 | IMAPAsyncConnection * IMAPAsyncSession::availableSession() |
| 320 | { |
| 321 | // try find existant session with empty queue for reusing. |
| 322 | IMAPAsyncConnection * chosenSession = sessionWithMinQueue(false, NULL); |
| 323 | if ((chosenSession != NULL) && (chosenSession->operationsCount() == 0)) { |
| 324 | return chosenSession; |
| 325 | } |
| 326 | |
| 327 | // create new session, if maximum connections limit does not reached yet. |
| 328 | if ((mMaximumConnections == 0) || (mSessions->count() < mMaximumConnections)) { |
| 329 | chosenSession = session(); |
| 330 | mSessions->addObject(chosenSession); |
| 331 | return chosenSession; |
| 332 | } |
| 333 | |
| 334 | // otherwise returns existant session with minimum size of queue. |
| 335 | return chosenSession; |
| 336 | } |
| 337 | |
| 338 | IMAPAsyncConnection * IMAPAsyncSession::matchingSessionForFolder(String * folder) |
| 339 | { |
nothing calls this directly
no test coverage detected