Skip to content
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

Improve IPC socket handling #2111

Merged
merged 3 commits into from Apr 7, 2019

Conversation

Projects
None yet
3 participants
@eht16
Copy link
Member

commented Mar 25, 2019

  • improve and extend logging of IPC socket errors (Windows and non-Windows)
  • do not raise the main window on Windows when --list-documents is used
  • bind the TCP port used for the IPC socket exclusively on Windows (should help with #641 & #2101)
@codebrainz

This comment has been minimized.

Copy link
Member

commented Mar 26, 2019

Looks good upon a quick review, and seems useful.

eht16 added some commits Mar 25, 2019

Use GLib logging for socket error messages
The "perror" logs were not very visible on non-Windows systems
(i.e. the user could see and notice them only when Geany was started
from the command line).
On Windows, those messages were never visible at all.

Add a new debug log message if Geany received an IPC command
from a remote instance.

Also, add a status bar and status window message if the initial socket
creation failed.
On Windows, raise the main window only when needed for IPC calls
We need to explicitly raise the main window on IPC commands
only when opening files and similar.
For query commands like "doclist" the focus should stay on the
remote instance.
Windows: Use SO_EXCLUSIVEADDRUSE flag for IPC socket
SO_REUSEADDR on Windows allows to bind to an already used port
without an error. This way we never notice if the port is already used.
So use the Windows special flag SO_EXCLUSIVEADDRUSE to ensure we receive
an error if the port is already used.

Part of #641.

@eht16 eht16 force-pushed the eht16:win32_socket_handling branch from ec10be0 to 690df74 Apr 7, 2019

@eht16 eht16 merged commit 00a5688 into geany:master Apr 7, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@eht16 eht16 deleted the eht16:win32_socket_handling branch Apr 7, 2019

@b4n b4n added this to the 1.35 milestone Apr 7, 2019

b4n added a commit that referenced this pull request Apr 9, 2019

Avoid passing plain strings as format
Introduced in #2111, this gets caught by GCC's -Wformat-security which
is enabled as an error in our nightly builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.