lookup session by id, return a copy if space provided
| 1808 | |
| 1809 | // lookup session by id, return a copy if space provided |
| 1810 | SSL_SESSION* Sessions::lookup(const opaque* id, SSL_SESSION* copy) |
| 1811 | { |
| 1812 | Lock guard(mutex_); |
| 1813 | sess_iterator find = STL::find_if(list_.begin(), list_.end(), |
| 1814 | sess_match(id)); |
| 1815 | if (find != list_.end()) { |
| 1816 | uint current = lowResTimer(); |
| 1817 | if ( ((*find)->GetBornOn() + (*find)->GetTimeOut()) < current) { |
| 1818 | del_ptr_zero()(*find); |
| 1819 | list_.erase(find); |
| 1820 | return 0; |
| 1821 | } |
| 1822 | if (copy) |
| 1823 | *copy = *(*find); |
| 1824 | return *find; |
| 1825 | } |
| 1826 | return 0; |
| 1827 | } |
| 1828 | |
| 1829 | |
| 1830 | // remove a session by id |
no test coverage detected