net compatibility improvements (#14933)

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
This commit is contained in:
Ciro Spaciari
2024-11-07 22:03:53 -08:00
committed by GitHub
parent c2e7643aa9
commit 183c661c40
65 changed files with 2307 additions and 323 deletions

View File

@@ -524,7 +524,8 @@ public:
/* Listen to port using this HttpContext */
us_listen_socket_t *listen(const char *host, int port, int options) {
auto socket = us_socket_context_listen(SSL, getSocketContext(), host, port, options, sizeof(HttpResponseData<SSL>));
int error = 0;
auto socket = us_socket_context_listen(SSL, getSocketContext(), host, port, options, sizeof(HttpResponseData<SSL>), &error);
// we dont depend on libuv ref for keeping it alive
if (socket) {
us_socket_unref(&socket->s);
@@ -534,7 +535,8 @@ public:
/* Listen to unix domain socket using this HttpContext */
us_listen_socket_t *listen_unix(const char *path, size_t pathlen, int options) {
auto* socket = us_socket_context_listen_unix(SSL, getSocketContext(), path, pathlen, options, sizeof(HttpResponseData<SSL>));
int error = 0;
auto* socket = us_socket_context_listen_unix(SSL, getSocketContext(), path, pathlen, options, sizeof(HttpResponseData<SSL>), &error);
// we dont depend on libuv ref for keeping it alive
if (socket) {
us_socket_unref(&socket->s);