Commit 0fa75356 authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot

folly: fix compilation on windows

Summary:
The type is `HANDLE` but is being passed to something that
wants an `int` for a socket/file descriptor, so let's
explicitly translate this into a socket descriptor.

Reviewed By: yfeldblum

Differential Revision: D14680671

fbshipit-source-id: c7b3f6058ca486dbda01b069ec5d67cc2b3ea478
parent fd2f5d20
...@@ -1001,7 +1001,15 @@ bool AsyncSSLSocket::willBlock( ...@@ -1001,7 +1001,15 @@ bool AsyncSSLSocket::willBlock(
return false; return false;
} }
auto asyncPipeReader = AsyncPipeReader::newReader(eventBase_, ofd); // On POSIX systems, OSSL_ASYNC_FD is type int, but on win32
// it has type HANDLE.
// Our NetworkSocket::native_handle_type is type SOCKET on
// win32, which means that we need to explicitly construct
// a native handle type to pass to the constructor.
auto native_handle = NetworkSocket::native_handle_type(ofd);
auto asyncPipeReader = AsyncPipeReader::newReader(
eventBase_, NetworkSocket(native_handle).toFd());
auto asyncPipeReaderPtr = asyncPipeReader.get(); auto asyncPipeReaderPtr = asyncPipeReader.get();
if (!asyncOperationFinishCallback_) { if (!asyncOperationFinishCallback_) {
asyncOperationFinishCallback_.reset( asyncOperationFinishCallback_.reset(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment