mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibCore: Use correct fd for NotifierActivationEvent on Windows
The initial IOCP event loop implementation had a fd() method for the EventLoopNotifier packet that did not actually return the fd for the notifier, but a to_fd() call on an object HANDLE that was always NULL. This meant we were always posting NotifierActivationEvents with a fd of 0. This rendered all of our WinSock2 I/O invalid, meaning no IPC messages would ever be successfully sent or received.
This commit is contained in:
parent
7d2f631d4c
commit
11b8bbeadf
Notes:
github-actions[bot]
2025-11-18 17:51:01 +00:00
Author: https://github.com/ayeteadoe
Commit: 11b8bbeadf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6838
Reviewed-by: https://github.com/R-Goc ✅
Reviewed-by: https://github.com/gmta ✅
1 changed files with 4 additions and 4 deletions
|
|
@ -92,12 +92,12 @@ struct EventLoopNotifier final : CompletionPacket {
|
||||||
}
|
}
|
||||||
|
|
||||||
Notifier::Type notifier_type() const { return m_notifier_type; }
|
Notifier::Type notifier_type() const { return m_notifier_type; }
|
||||||
int fd() const { return to_fd(object_handle); }
|
int notifier_fd() const { return m_notifier_fd; }
|
||||||
|
|
||||||
// These are a space tradeoff for avoiding a double indirection through the notifier*.
|
// These are a space tradeoff for avoiding a double indirection through the notifier*.
|
||||||
Notifier* notifier;
|
Notifier* notifier;
|
||||||
Notifier::Type m_notifier_type;
|
Notifier::Type m_notifier_type;
|
||||||
HANDLE object_handle;
|
int m_notifier_fd { -1 };
|
||||||
OwnHandle wait_packet;
|
OwnHandle wait_packet;
|
||||||
OwnHandle wait_event;
|
OwnHandle wait_event;
|
||||||
};
|
};
|
||||||
|
|
@ -187,8 +187,8 @@ size_t EventLoopImplementationWindows::pump(PumpMode pump_mode)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (packet->type == CompletionType::Notifer) {
|
if (packet->type == CompletionType::Notifer) {
|
||||||
auto* notifier_data = reinterpret_cast<EventLoopNotifier*>(packet);
|
auto* notifier_data = static_cast<EventLoopNotifier*>(packet);
|
||||||
event_queue.post_event(*notifier_data->notifier, make<NotifierActivationEvent>(notifier_data->fd(), notifier_data->notifier_type()));
|
event_queue.post_event(*notifier_data->notifier, make<NotifierActivationEvent>(notifier_data->notifier_fd(), notifier_data->notifier_type()));
|
||||||
g_system.NtAssociateWaitCompletionPacket(notifier_data->wait_packet.handle, thread_data->iocp.handle, notifier_data->wait_event.handle, notifier_data, NULL, 0, 0, NULL);
|
g_system.NtAssociateWaitCompletionPacket(notifier_data->wait_packet.handle, thread_data->iocp.handle, notifier_data->wait_event.handle, notifier_data, NULL, 0, 0, NULL);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue