mirror of
https://github.com/neovim/neovim.git
synced 2026-08-26 00:51:53 +00:00
fix(channel): handle socket accept failure #41240
(cherry picked from commit 4b8c4dfc68)
This commit is contained in:
committed by
github-actions[bot]
parent
f93cb68717
commit
92aa95bd47
@@ -524,7 +524,12 @@ end:
|
||||
void channel_from_connection(SocketWatcher *watcher)
|
||||
{
|
||||
Channel *channel = channel_alloc(kChannelStreamSocket);
|
||||
socket_watcher_accept(watcher, &channel->stream.socket);
|
||||
int result = socket_watcher_accept(watcher, &channel->stream.socket);
|
||||
if (result != 0) {
|
||||
ELOG("Failed to accept connection: %s", uv_strerror(result));
|
||||
channel_destroy_early(channel);
|
||||
return;
|
||||
}
|
||||
channel->stream.socket.s.internal_close_cb = close_cb;
|
||||
channel->stream.socket.s.internal_data = channel;
|
||||
wstream_init(&channel->stream.socket.s, 0);
|
||||
|
||||
Reference in New Issue
Block a user