Setup ssldata 1) ctx 2) cert 3) swapping queue Ownership of unique pointers are transferred into this function Then if the entry is found, the ownership is further transferred to the entry if not, the objects are destroyed here. (As per design, this is caused by LRU management deleting oldest entry)
| 174 | // Then if the entry is found, the ownership is further transferred to the entry |
| 175 | // if not, the objects are destroyed here. (As per design, this is caused by LRU management deleting oldest entry) |
| 176 | void |
| 177 | setup_data_ctx(const std::string &commonName, std::queue<void *> &localQ, std::unique_ptr<SSL_CTX> ctx, |
| 178 | std::unique_ptr<X509> cert, const bool &wontdo) |
| 179 | { |
| 180 | TSMutexLock(list_mutex); |
| 181 | auto iter = cnDataMap.find(commonName); |
| 182 | if (iter != cnDataMap.end()) { |
| 183 | std::swap(localQ, iter->second->vconnQ); |
| 184 | iter->second->ctx = std::move(ctx); |
| 185 | iter->second->cert = std::move(cert); ///< We might not need cert, can be easily removed |
| 186 | iter->second->wontdo = wontdo; |
| 187 | } |
| 188 | TSMutexUnlock(list_mutex); |
| 189 | } |
| 190 | |
| 191 | // Prepend to the LRU list |
| 192 | void |
no test coverage detected