-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix event created for WSAEventSelect #2750
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…lect should be WSAEVENT instead of normal event. From MSDN, it looks same as CreateEvent(NULL, FALSE, FALSE, NULL): The WSACreateEvent function creates a manual-reset event object with an initial state of nonsignaled. The event object is unnamed. However they are not really equivalent. When we use normal event, the WSAEventSelect still works but the event appears to be 'auto-reset'.
Refer to this link for build results (access rights to CI server needed): |
@realjiangms According to MSDN Good catch though, +1 |
+1 |
1 similar comment
+1 |
hardening
added a commit
that referenced
this pull request
Jul 2, 2015
Fix event created for WSAEventSelect
realjiangms
added a commit
to realjiangms/FreeRDP
that referenced
this pull request
Sep 3, 2015
…d by FreeRDP#2750. We used to fall in lool after FreeRDP#2750. The reason is that we attach to FD_WRITE event. This should not be expected. Because WSAEventSelect attaches to FD_WRITE, it is always in 'set' state even when we drain the read buffer. It was first fixed in PR FreeRDP#2770. However the solution introduced another issue on Linux. This PR discards the fix in FreeRDP#2770 Later A quick fix for FreeRDP#2770 was introduced in FreeRDP#2790/FreeRDP#2791. It is also discarded together.
realjiangms
added a commit
to realjiangms/FreeRDP
that referenced
this pull request
Sep 3, 2015
…d by FreeRDP#2750. We used to fall in lool after 2750. The reason is that we attach to FD_WRITE event. This should not be expected. Because WSAEventSelect attaches to FD_WRITE, it is always in 'set' state even when we drain the read buffer. It was first fixed in PR 2770. However the solution introduced another issue on Linux. This PR discards the fix in 2770 Later A quick fix for 2770 was introduced in 2790/2791. It is also discarded together.
realjiangms
added a commit
to realjiangms/FreeRDP
that referenced
this pull request
Sep 4, 2015
1. Fix socket event (created by WSAEventCreate) handling for win32. This is to fix the issue which uncovered by FreeRDP#2750. We used to fall in loop after 2750. The reason is event created by WSAEventSelect on windows need manually reset, it is always in 'set' state even when we run out of the read buffer. It was first fixed in PR 2770. However the solution introduced another issue on Linux. This PR discards the fix in 2770 Later A quick fix for 2770 was introduced in 2790/2791. It is also discarded together. This fix try to keep usage same on Windows and Posix. 2. Fix argument for WSAEventSelect on win32 to be consistent with Linux. 3. Fix tcp event for listener.
realjiangms
added a commit
to realjiangms/FreeRDP
that referenced
this pull request
Sep 5, 2015
1. Fix socket event (created by WSAEventCreate) handling for win32. This is to fix the issue which uncovered by FreeRDP#2750. We used to fall in loop after 2750. The reason is event created by WSAEventSelect on windows need manually reset, it is always in 'set' state even when we run out of the read buffer. It was first fixed in PR 2770. However the solution introduced another issue on Linux. This PR discards the fix in 2770 Later A quick fix for 2770 was introduced in 2790/2791. It is also discarded together. This fix try to keep usage same on Windows and Posix. 2. Fix argument for WSAEventSelect on win32 to be consistent with Linux. 3. Fix tcp event for listener.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix event created for WSAEventSelect: The event we pass to WSAEventSelect should be WSAEVENT instead of normal event.
From MSDN, it looks same as CreateEvent(NULL, FALSE, FALSE, NULL):
The WSACreateEvent function creates a manual-reset event object with an initial state of nonsignaled. The event object is unnamed.
However they are not really equivalent. When we use normal event, the WSAEventSelect still works but the event appears to be 'auto-reset'.
On my Win7 in labtop and Win7 in virtual machine, the client connection always stuck because the WSA event is 'consumed' by WaitForMultipleObjects and the later WaitForSingleObject only get a 'timeout'
I found this issue when testing shadow server on win7.