Commit Graph

3284 Commits

Author SHA1 Message Date
crs 1cbdaee31b added better handling of X server disconnecting unexpectedly.
the apps still exit but they do it in a mostly controlled
manner.  in particular, the server threads except the one
processing primary screen events will terminate gracefully.
this will be important should the server ever allow HTTP
clients to rewrite the configuration file.

note that X makes it effectively impossible to continue once
the X server disconnects.  even if it didn't it would be
difficult for synergy to recover.  users will have to add
synergy to the X display manager's startup script if they
expect the server to be restarted.  alternatively, we could
add code to fork synergy at startup;  the child would do
the normal work while the parent would simply wait for the
child to exit and restart it.
2002-06-03 13:45:30 +00:00
crs ddbb465540 shortened poll() timeout. 2002-06-02 23:07:57 +00:00
crs ad15393732 changed buffered output stream to wait() when flush()ing instead
of polling/sleeping.  changed CTCPSocket to not use thread
cancellation but to instead use m_connected to exit the thread.
also shortened poll timeout.
2002-06-02 22:57:50 +00:00
crs 1e988b3839 make sleep shorter in poll/sleep getEvent() loops. 2002-06-02 21:35:20 +00:00
crs a541ebc557 removed poll/sleep code to improve performance. 2002-06-02 21:03:38 +00:00
crs 869617a34a now ignores key if there's no key mapped for a required modifier.
was asserting (on the wrong expression).
2002-06-02 19:04:24 +00:00
crs 1d3807cb0e added SIGINT and SIGTERM handling to unix client and server.
either signal causes the main thread to be cancelled.  added
necessary code to make main thread cancellation clean up
nicely.
2002-06-02 18:49:35 +00:00
crs 1da9be88c9 added a maximum request size to CHTTPProtocol so we can bail
on clients that cause us to use too much memory.  also put
methods in CHTTPRequest to get/set headers and changed the
data structure used to store them.  fixed a couple of other
miscellaneous bugs in CHTTPProtocol.cpp.
2002-06-02 13:34:35 +00:00
crs fa4d24216f now limiting number of simultaneous HTTP requests being handled
at once.  this is to prevent denial of service.
2002-06-02 11:49:46 +00:00
crs d2135af0d9 fixes, mainly for windows. first, had to add a notification from
CServer to the primary screen when the configuration changes so it
can make necessary adjustments (the win32 primary screen must tell
the hook dll about the new jump zones).

changed includes of some std c++ library files to go through
our own include files.  these wrap the include with stuff to
keep vc++ quiet when compiling at warning level 4, which is
what it does now.  it also works around missing <istream> and
<ostream> on g++2.96.

added missing std:: where necessary.  g++ doesn't really support
namespaces so it lets references without the namespace slip
through.

added workaround or fix.  not sure if istringstream::str(string)
should reset eofbit.  it does on g++ but does not on vc++.
added clear() after str() so it works either way.

added low-level keyboard hook to win32.  if available (it's only
available on NT SP3 and up) it allows us to catch and handle
alt+tab, alt+esc, ctrl+esc, and windows key hot keys.  i think
that leaves only ctrl+alt+del and accessibility functions
uncaught on those systems.
2002-06-01 19:26:11 +00:00
crs 1ac62a9533 added mutex to all public methods that didn't already have it.
fixed two blown assertions.  first, if user tried to switch to
a client that had connected but hadn't yet sent the first info
message it would assert on the zero size screen.  second, if
the primary screen was handling a mouse motion on behalf of a
secondary screen when that secondary screen disconnected then
an assert would blow because the primary screen would call
onMouseMoveSecondary() but m_protocol on the active screen is
NULL because disconnecting the active secondary screen caused
the mouse to jump to the primary screen.
2002-06-01 10:52:02 +00:00
crs 3a80df28dd changed iterator to use iterator_traits directly instead of
std::iterator to support the old STL on grace.
2002-05-31 18:35:53 +00:00
crs 793c968f00 server now rejects clients that are not in the configuration.
added a protocol message to indicate this.
2002-05-31 18:18:29 +00:00
crs 1e8a5d7fa9 fixed setConfig() to disconnect secondary screens that aren't
in the new configuration.
2002-05-31 18:09:43 +00:00
crs 71c374b6cd made isScreen() a const method. 2002-05-31 18:08:08 +00:00
crs 942e57fc8d added I/O for configuration files and changed the server to use
an external file for its configuration (was hard coding a config
for testing).
2002-05-31 17:32:26 +00:00
crs 0eccd52226 finished renaming CScreenMap to CConfig. 2002-05-31 14:44:54 +00:00
crs 67b149d3a4 checkpoint. changed CScreenMap to CConfig. must still change
CScreenMap.cpp to CConfig.cpp.
2002-05-31 14:43:23 +00:00
crs ed96354bad checkpoint. renamed CScreenMap.h to CConfig.h. will be
changing CScreenMap to CConfig everywhere.
2002-05-31 14:34:16 +00:00
crs 536eb52337 added methods to CLog for getting the outputter, getting and
setting the priority filter, and added code for thread safety.
added code to apps to enable thread safety in CLog.
2002-05-31 14:25:26 +00:00
crs 70f5f9491d added basic support for an embedded HTTP server. server
currently supports editing the screen map but changing
the map won't behave correctly if there are connected
screens.
2002-05-30 16:13:16 +00:00
crs 2cc63e31aa fixed bug in closing down a socket. 2002-05-30 16:11:59 +00:00
crs 8cb0302665 updated win32 clipboard to match new model. 2002-05-27 18:55:51 +00:00
crs f5a6d2738a checkpoint 2002-05-27 18:35:14 +00:00
crs 189537b8b9 removed getEventMask() from primary screen. added a class to
CXWindowsUtil that installs/uninstalls an X error hander.
using that in primary screen, clipboard, and util to ensure
that certain errors don't kill the app.
2002-05-27 18:30:13 +00:00
crs 7cf20d9ad0 removed getEventMask() and fixed some comments. also now using
toggle key states in updateModifiers().
2002-05-27 18:28:06 +00:00
crs f8eb775278 changed lesstif hack to only apply to the CLIPBOARD selection.
apprently the PRIMARY selection must follow the ICCCM protocol
correctly.
2002-05-27 17:05:34 +00:00
crs 56d7271bc1 added missing files from previous submit. 2002-05-27 16:51:07 +00:00
crs 854d2c7fbf checkpoint. changed clipboard model. the clipboard can only
be accessed now between open()/close().  ownership of the
clipboard is asserted via the empty() method.  this parallels
the win32 model (but the win32 code hasn't been updated yet).

refactored X11 clipboard code.  moved the bulk of it into
CXWindowsClipboard and moved some comment event handling into
CXWindowsScreen.  changed how requests are processed into a
hopefully easier to understand model.  added support for getting
clipboard from and sending clipboard to motif (or at least
lesstif) clients.  sending to lesstif required a hack to work
around an apparent bug in lesstif.
2002-05-27 16:22:59 +00:00
crs 097882b71c checkpoint 2002-05-24 17:54:34 +00:00
crs 5fc87baa0f added screen locking support to win32. added support for
resolution changing (only semi-supported on X because that
has no means for resizing screen anyway).  also fixed some
clipboard problems on win32.
2002-05-24 17:54:28 +00:00
crs 34c587e864 added support for locking to a screen when the sroll lock is
toggled on or when any key or button is pressed.  fully
implemented on X but stubbed out for now on win32.
2002-05-24 14:37:12 +00:00
crs a0b25b9d4a checkpoint 2002-05-23 18:35:15 +00:00
crs e277e6e74a added support for mouse wheel on win32. 2002-05-23 18:35:08 +00:00
crs 24f5b66cf3 added support for mouse wheel on X. 2002-05-23 15:50:38 +00:00
crs 4542bb9e40 added a third screen to hard coded map for testing purposes. 2002-05-23 15:00:39 +00:00
crs 9ce7a2757a fixed log message. 2002-05-23 15:00:13 +00:00
crs 13eee14232 server no longer asserts when a client connects with a name that's
already in use by another client.  also added reporting of errors
from the server to clients so clients can report meaningful
messages to users.
2002-05-23 14:56:03 +00:00
crs 995771eec1 checkpoint 2002-05-23 14:04:43 +00:00
crs 6611ea871e changed structs to classes. there should be no more structs now. 2002-05-23 14:04:35 +00:00
crs 6697bd900e checkpoint. 2002-05-22 17:09:08 +00:00
crs 8df02380e5 removed unnecessary call in screen class, added logging calls
in clipboard class, and added another cast in protocol util
to avoid warning on win32.
2002-05-22 17:08:37 +00:00
crs 9e161163b0 now letting some key events filter through. this allows the
keyboard lights to track toggle changes.  however, it also
seems to let through keyboard events that shouldn't get
through.
2002-05-22 17:05:26 +00:00
crs 685bcfa05f fixed incorrect for-loop over directions conditional. 2002-05-22 17:02:58 +00:00
crs a5ae8011e2 win32 changes. replaced log dialog hack with a windows console
window.  now attaching thread input queues as necessary. shifted
code around so toggling toggle keys is immediately reflected by
secondary screen's keyboard.  now setting extended key flag for
keys that need it.  fixed handling of shift + caps-lock.  added
handling of keys that should distinguish between left and right
but don't.  fixed get/set of active window on leave/enter of
primary screen.  replaced 1x1 primary window with a full screen
window to work around a problem with losing key events.  changed
calculation of mouse move deltas.
2002-05-22 17:01:17 +00:00
crs d893cc16a8 fixed type of socket handle (from int to CNetwork::Socket). 2002-05-22 16:56:06 +00:00
crs 5c760183ce removed blank line. 2002-05-22 16:55:19 +00:00
crs 024f76c909 changed un-inlined code to avoid bogus VC++ level 4 warnings.
added support for more win32 thread priorities.
2002-05-22 16:55:05 +00:00
crs cda243ac76 fixed parameter type for socket port. 2002-05-22 16:51:59 +00:00
crs aa125b07c5 changed set of disabled win32 warnings. 2002-05-22 16:43:14 +00:00