Bug 10916 - Xming: Strengthen and correct clipboard select() loops
Summary: Xming: Strengthen and correct clipboard select() loops
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/DDX/Xwin (show other bugs)
Version: unspecified
Hardware: Other Windows (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 18093
  Show dependency treegraph
 
Reported: 2007-05-11 07:32 UTC by Colin Harrison
Modified: 2010-03-23 04:52 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch to fix (1.86 KB, patch)
2007-05-11 07:34 UTC, Colin Harrison
no flags Details | Splinter Review
Better patch to fix (2.09 KB, patch)
2007-06-03 10:56 UTC, Colin Harrison
no flags Details | Splinter Review

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.