Skip to content

Conversation

@botovq
Copy link
Contributor

@botovq botovq commented Aug 2, 2024

This might fix #1076

@datadiode
Copy link
Contributor

You may want to wrap winsock select() as well to ensure that it will still see the timeval struct layout it expects.

@LainOTN2
Copy link

LainOTN2 commented Aug 6, 2024

Tested on OpenSSH portable, and it fixes the issues on Win32 builds.

@botovq
Copy link
Contributor Author

botovq commented Aug 6, 2024 via email

botovq and others added 3 commits October 6, 2024 18:56
Otherwise it sets looptime to -1, which was skipped by select()
and caused 100% cpu busy looping.
This prevents the compatibility struct timeval definition in
sys/time.h from potentially getting used with select() here.

https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-select
@busterb
Copy link
Contributor

busterb commented Oct 7, 2024

I made a change to poll_win.c to ensure that we use the appropriate timeval definition with select with Windows. We were anyway, because sys/time.h isn't used in Windows' select definition, but still just in case.

This also fixes an issue where select was given {0, 4294967296} when poll was given a timeout value of -1, which caused poll() to spin with no timeout internally, noticed while logging internal behavior with openssl s_client.

@busterb
Copy link
Contributor

busterb commented Oct 8, 2024

Going to land this now

@busterb busterb merged commit 64f15ec into libressl:master Oct 8, 2024
@botovq
Copy link
Contributor Author

botovq commented Oct 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gettimeofday implementation for MSVC cannot handle dates beyond 2038

4 participants