|
From: | Alex Matei |
Subject: | bug#45821: Emacs UDP support on Windows |
Date: | Mon, 2 Jan 2023 22:56:04 +0000 |
Thanks for the tips with logging! I think I found the fix (at least for one of the issues?)
Please see the attached patch/diff for the fix. The code will always ignore (aka ‘eat’) one character if the file descriptor had the least significant bit set (0x1, so this would mean for any file descriptor with READ flag set) Based on operator precedence rules, FILE_SOCKET == 0 will be evaluated first (before &) , resulting in 0, which would effectively cause the condition to always be false This behavior can be observed when executing a call to ‘(async-shell-command)’ (-> file descriptor flags 0x191) on a build with the patch vs one without the patch applied (see below, attached image)
@Robert Pluim I don’t know if this was the only missing piece, but from all my tests I couldn’t see any issues with TLS anymore, and with navigating https://gnu.org in EWW.. I wanted to thank you for creating this patch 🙏, and giving me pointers on how to apply and debug it. In the meantime, I will continue to selfhost EWW and see if there are still other issues lurking around beyond this fix. Funny enough, I ended up with good old ‘printf’, since it was nicely integrated with my build workflow: I would build and then just run emacs.exe from the shell => all my logging was nicely displayed there. ( message1 is also super nice,
especially for useful user messages). p.s. - The patch also adds STATUS_READ_IN_PROGRESS state for the new ‘_sys_wait_readable’ function , based on what the read ahead logic was doing already (idk if it is needed, but it is a nice mirror, and a good status code to reflect, although I am not convinced anyone cares about this state transition..) - I checked in other places of the code if we have issues with operator precedence for comparing socket flags, etc. and we are safe, most probably because we don’t bother with explicit equality conditions (like == 0) and instead we use the short form `if ( flag & socket_flag)`) Sent from Mail for Windows From: Eli Zaretskii > From: Robert Pluim <rpluim@gmail.com> |
45821-fix.txt
Description: 45821-fix.txt
[Prev in Thread] | Current Thread | [Next in Thread] |