Bug 10916

Summary: Xming: Strengthen and correct clipboard select() loops
Product: xorg Reporter: Colin Harrison <colin.harrison>
Component: Server/DDX/XwinAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 18093    
Attachments:
Description Flags
Patch to fix
none
Better patch to fix none

Description Colin Harrison 2007-05-11 07:32:31 UTC
The Xming/Cygwin/X uses two select() loops to handle the clipboard integration with MS Windows. These need to be strengthened and corrected as follows...

1) On connection timeout in winProcessXEventsTimeout() try to repair sockets using a call to 'os/connection.c:CheckConnections()'.
2) In winProcessXEventsTimeout() move the declaration of an automatic variable out of the select() loop.
3) In winClipboardProc() lengthen the select() timeout by a factor of 1000 (from 100usec to 100ms) to slow the poll rate to something more sensible.
4) In winClipboardProc() descriptor sets should not be checked (i.e. by calling FD_ISSET) unless the return value from select() is greater than 0. The state of descriptor sets can be indeterminate otherwise. This case is specific to Xming as Cygwin/X doesn't set a select() timeout and so never returns 0.
Comment 1 Colin Harrison 2007-05-11 07:34:36 UTC
Created attachment 9929 [details] [review]
Patch to fix
Comment 2 Colin Harrison 2007-06-03 10:56:35 UTC
Created attachment 10166 [details] [review]
Better patch to fix

Better if we continue on error WSAEINTR to prevent unnecessary disconnects.
Comment 3 Yaakov Selkowitz 2010-03-23 03:42:56 UTC
Is this still necessary?
Comment 4 Colin Harrison 2010-03-23 04:52:11 UTC
Report no longer applies as many a bodge has been applied to the clipboard since.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.