mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Schwartzmeyer <>
Subject Re: Review Request 62510: Fixed `LibeventSSLSocketImpl` for Windows file descriptors.
Date Mon, 02 Oct 2017 23:47:42 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated Oct. 2, 2017, 4:47 p.m.)

Review request for mesos, John Kordich, Joseph Wu, and Till Toenshoff.


Inserted patch into middle of chain, fixed dependency.

Bugs: MESOS-7992

Repository: mesos


This patch introduces the `int_fd` abstraction we use elsewhere to the
`LibeventSSLSocketImpl` for dealing with Linux versus Windows file
descriptors. This is necessary because on Windows, the consumer of
`LibeventSSLSocketImpl::create()` etc. already use `int_fd`.

Note that this does not break Linux systems, as `int_fd` is defined as
`int` on all non-Windows systems.

On Windows, however, in `evbuffer_add_file` we must explicitly convert
from `int_fd` (holding a Windows file handle) to a CRT `int` file
descriptor (the platform-specific call to `crt()`).

We have to correct the type expected by `evconnlistener_new` from `int`
to `evutil_socket_t`. This previously worked as just an `int` because
that is the underlying type used for sockets by libevent on Linux, but
it instead uses `intptr_t` on Windows. The `int_fd` abstraction can be
casted to `intptr_t` (and thus `evutil_socket_t`) automatically, but not
`int`, and so correcting the type to `evutil_socket_t` allows us to use
this lambda for the listener.


  3rdparty/libprocess/src/libevent_ssl_socket.hpp 9493a50243340a1c48ab1c67f6e61cc081ef24ce

  3rdparty/libprocess/src/libevent_ssl_socket.cpp 5767ce04391ee37076d9f97f65084febd0aefbdb




Andrew Schwartzmeyer

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message