| 1004 | |
| 1005 | |
| 1006 | Future<std::shared_ptr<SocketImpl>> LibeventSSLSocketImpl::accept() |
| 1007 | { |
| 1008 | // Note that due to MESOS-8448, when the caller discards, it's |
| 1009 | // possible that we pull an accepted socket out of the queue but |
| 1010 | // drop it when `.then` transitions to discarded rather than |
| 1011 | // executing the continuation. This is currently acceptable since |
| 1012 | // callers only discard when they're breaking their accept loop. |
| 1013 | // However, from an API perspective, we shouldn't be dropping |
| 1014 | // the socket on the floor. |
| 1015 | // |
| 1016 | // We explicitly specify the return type to avoid a type deduction |
| 1017 | // issue in some versions of clang. See MESOS-2943. |
| 1018 | return accept_queue.get() |
| 1019 | .then([](const Future<std::shared_ptr<SocketImpl>>& impl) |
| 1020 | -> Future<std::shared_ptr<SocketImpl>> { |
| 1021 | CHECK(!impl.isPending()); |
| 1022 | return impl; |
| 1023 | }); |
| 1024 | } |
| 1025 | |
| 1026 | |
| 1027 | void LibeventSSLSocketImpl::peek_callback( |