Only runs in event loop. No locks required. See 'Locking' note at top of file.
| 221 | // Only runs in event loop. No locks required. See 'Locking' note at |
| 222 | // top of file. |
| 223 | void LibeventSSLSocketImpl::recv_callback(bufferevent* /*bev*/, void* arg) |
| 224 | { |
| 225 | CHECK(__in_event_loop__); |
| 226 | |
| 227 | std::weak_ptr<LibeventSSLSocketImpl>* handle = |
| 228 | reinterpret_cast<std::weak_ptr<LibeventSSLSocketImpl>*>(CHECK_NOTNULL(arg)); |
| 229 | |
| 230 | std::shared_ptr<LibeventSSLSocketImpl> impl(handle->lock()); |
| 231 | |
| 232 | // Don't call the 'recv_callback' unless the socket is still valid. |
| 233 | if (impl != nullptr) { |
| 234 | impl->recv_callback(); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | |
| 239 | // Only runs in event loop. Member function continuation of static |