2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Use libuv-provided uv_{export,import} if available.

We were using our own versions of isc_uv_{export,import} functions
for multithreaded TCP listeners. Upcoming libuv version will
contain proper uv_{export,import} functions - use them if they're
available.
This commit is contained in:
Witold Kręcicki
2020-01-31 10:10:44 +01:00
parent a0d36d7601
commit 093af1a609
8 changed files with 34 additions and 4 deletions

View File

@@ -15,6 +15,7 @@
#include <isc/util.h>
#ifndef HAVE_UV_IMPORT
/*
* XXXWPK: This code goes into libuv internals and it's platform dependent.
* It's ugly, we shouldn't do it, but the alternative with passing sockets
@@ -185,3 +186,5 @@ isc_uv_import(uv_stream_t *stream, isc_uv_stream_info_t *info) {
return (uv_tcp_open(tcp, info->fd));
}
#endif /* ifdef WIN32 */
#endif /* ifndef HAVE_UV_IMPORT */

View File

@@ -33,6 +33,14 @@ uv_handle_set_data(uv_handle_t *handle, void *data) {
}
#endif /* ifndef HAVE_UV_HANDLE_SET_DATA */
#ifdef HAVE_UV_IMPORT
#define isc_uv_stream_info_t uv_stream_info_t
#define isc_uv_export uv_export
#define isc_uv_import uv_import
#else
/*
* These functions are not available in libuv, but they're very internal
* to libuv. We should try to get them merged upstream.
@@ -69,3 +77,5 @@ isc_uv_import(uv_stream_t *stream, isc_uv_stream_info_t *info);
* Imports uv_stream_info_t value into uv_stream_t to initialize a
* shared stream.
*/
#endif