Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: GitHub <noreply(a)github.com>
Date: Sat, 26 Sep 2020 10:00:59 UTC
Commit: c5def0133267917257a2c1f14e112e7c2e8d94b7
https://github.com/geany/geany/commit/c5def0133267917257a2c1f14e112e7c2e8d9…
Log Message:
-----------
Windows: Make TCP socket port number configurable (#2585)
Windows: Make TCP socket port number configurable
Make the previously hard-coded TCP port number for IPC on Windows
configurable and change the default value to be outside of the
dynamic port range used by Hyper-V.
Modified Paths:
--------------
doc/geany.txt
src/keyfile.c
src/libmain.c
src/prefs.h
src/socket.c
src/socket.h
Modified: doc/geany.txt
6 lines changed, 6 insertions(+), 0 deletions(-)
===================================================================
@@ -2674,6 +2674,12 @@ number_non_ft_menu_items The maximum number of menu items in the 3
independent build section.
number_exec_menu_items The maximum number of menu items in the 2 on restart
execute section of the Build menu.
+**``socket`` group**
+socket_remote_cmd_port TCP port number to be used for inter 2 on restart
+ process communication (i.e. with other
+ Geany instances, e.g. "Open with Geany").
+ Only available on Windows, valid port
+ range: 1024 to 65535.
================================ =========================================== ========== ===========
Statusbar Templates
Modified: src/keyfile.c
9 lines changed, 9 insertions(+), 0 deletions(-)
===================================================================
@@ -46,6 +46,7 @@
#include "printing.h"
#include "project.h"
#include "sciwrappers.h"
+#include "socket.h"
#include "stash.h"
#include "support.h"
#include "symbols.h"
@@ -274,6 +275,14 @@ static void init_pref_groups(void)
stash_group_add_boolean(group, &search_prefs.replace_and_find_by_default,
"replace_and_find_by_default", TRUE);
+ group = stash_group_new(PACKAGE);
+ configuration_add_various_pref_group(group, "socket");
+
+#ifdef G_OS_WIN32
+ stash_group_add_integer(group, (gint*)&prefs.socket_remote_cmd_port,
+ "socket_remote_cmd_port", SOCKET_WINDOWS_REMOTE_CMD_PORT);
+#endif
+
/* Note: Interface-related various prefs are in ui_init_prefs() */
/* various build-menu prefs */
Modified: src/libmain.c
34 lines changed, 33 insertions(+), 1 deletions(-)
===================================================================
@@ -395,6 +395,34 @@ static void get_line_and_column_from_filename(gchar *filename, gint *line, gint
#ifdef G_OS_WIN32
+static gint get_windows_socket_port(void)
+{
+ /* Read config file early to get TCP port number as we need it for IPC before all
+ * other settings are read in load_settings() */
+ gchar *configfile = g_build_filename(app->configdir, "geany.conf", NULL);
+ GKeyFile *config = g_key_file_new();
+ gint port_number;
+
+ if (! g_file_test(configfile, G_FILE_TEST_IS_REGULAR))
+ {
+ geany_debug(
+ "No user config file found, use default TCP port (%s).",
+ SOCKET_WINDOWS_REMOTE_CMD_PORT);
+ g_free(configfile);
+ return SOCKET_WINDOWS_REMOTE_CMD_PORT;
+ }
+ g_key_file_load_from_file(config, configfile, G_KEY_FILE_NONE, NULL);
+ port_number = utils_get_setting_integer(config, PACKAGE, "socket_remote_cmd_port",
+ SOCKET_WINDOWS_REMOTE_CMD_PORT);
+ geany_debug("Using TCP port number %d for IPC", port_number);
+ g_free(configfile);
+ g_key_file_free(config);
+ g_return_val_if_fail(port_number >= 1024 && port_number <= (gint)G_MAXUINT16,
+ SOCKET_WINDOWS_REMOTE_CMD_PORT);
+ return port_number;
+}
+
+
static void change_working_directory_on_windows(void)
{
gchar *install_dir = win32_get_installation_dir();
@@ -1089,9 +1117,13 @@ gint main_lib(gint argc, gchar **argv)
/* check and create (unix domain) socket for remote operation */
if (! socket_info.ignore_socket)
{
+ gushort socket_port = 0;
+#ifdef G_OS_WIN32
+ socket_port = (gushort) get_windows_socket_port();
+#endif
socket_info.lock_socket = -1;
socket_info.lock_socket_tag = 0;
- socket_info.lock_socket = socket_init(argc, argv);
+ socket_info.lock_socket = socket_init(argc, argv, socket_port);
/* Quit if filenames were sent to first instance or the list of open
* documents has been printed */
if ((socket_info.lock_socket == -2 /* socket exists */ && argc > 1) ||
Modified: src/prefs.h
3 lines changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -39,6 +39,9 @@ typedef struct GeanyPrefs
gchar *default_open_path; /**< Default path to look for files when no other path is appropriate. */
gchar *custom_plugin_path;
gboolean save_wingeom;
+#ifdef G_OS_WIN32
+ gint socket_remote_cmd_port;
+#endif
}
GeanyPrefs;
Modified: src/socket.c
7 lines changed, 3 insertions(+), 4 deletions(-)
===================================================================
@@ -95,7 +95,6 @@
#ifdef G_OS_WIN32
-#define REMOTE_CMD_PORT 49876
#define SOCKET_IS_VALID(s) ((s) != INVALID_SOCKET)
#else
#define SOCKET_IS_VALID(s) ((s) >= 0)
@@ -248,7 +247,7 @@ static void check_socket_permissions(void)
* (taken from Sylpheed, thanks)
* Returns the created socket, -1 if an error occurred or -2 if another socket exists and files
* were sent to it. */
-gint socket_init(gint argc, gchar **argv)
+gint socket_init(gint argc, gchar **argv, G_GNUC_UNUSED gushort socket_port)
{
gint sock;
#ifdef G_OS_WIN32
@@ -269,13 +268,13 @@ gint socket_init(gint argc, gchar **argv)
* and which is unused. This port number has to be guessed by the first and new instance
* and the only data is the configuration directory path.
* For now we use one port number, that is we support only one instance at all. */
- sock = socket_fd_open_inet(REMOTE_CMD_PORT);
+ sock = socket_fd_open_inet(socket_port);
if (sock < 0)
return -1;
return sock;
}
- sock = socket_fd_connect_inet(REMOTE_CMD_PORT);
+ sock = socket_fd_connect_inet(socket_port);
if (sock < 0)
return -1;
#else
Modified: src/socket.h
7 lines changed, 6 insertions(+), 1 deletions(-)
===================================================================
@@ -26,6 +26,11 @@
G_BEGIN_DECLS
+/* Used on Windows for TCP socket based IPC.
+ * The port number is just random but should be below 49152 as Hyper-V tends to bind
+ * dynamic port ranges from 49152 to 65535. */
+#define SOCKET_WINDOWS_REMOTE_CMD_PORT 45937
+
struct SocketInfo
{
gboolean ignore_socket;
@@ -37,7 +42,7 @@ struct SocketInfo
extern struct SocketInfo socket_info;
-gint socket_init(gint argc, gchar **argv);
+gint socket_init(gint argc, gchar **argv, gushort socket_port);
gboolean socket_lock_input_cb(GIOChannel *source, GIOCondition condition, gpointer data);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Matthew Brush <mbrush(a)codebrainz.ca>
Date: Mon, 21 Sep 2020 01:15:45 UTC
Commit: 1f01c138942fd5f9f05b9a8d0657e92576e53ea3
https://github.com/geany/geany/commit/1f01c138942fd5f9f05b9a8d0657e92576e53…
Log Message:
-----------
Remove geany.glade from POTFILES.skip
This file is no longer compiled to `src/interface.c`, has moved, and is in fact now translated.
Modified Paths:
--------------
po/POTFILES.skip
Modified: po/POTFILES.skip
2 lines changed, 0 insertions(+), 2 deletions(-)
===================================================================
@@ -2,8 +2,6 @@
# geany.desktop.in will be translated
geany.desktop.in
-# generated src/interface.c will be translated
-geany.glade
# no need to translate these files
plugins/demoplugin.c
plugins/demoproxy.c
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/codebrainz-patch-1
Author: Matthew Brush <matt(a)geany.org>
Committer: GitHub <noreply(a)github.com>
Date: Sun, 20 Sep 2020 21:03:22 UTC
Commit: 7c0b97ceecfb55b11c76e2e267ebbaf62c306b49
https://github.com/geany/geany/commit/7c0b97ceecfb55b11c76e2e267ebbaf62c306…
Log Message:
-----------
Remove geany.glade from POTFILES.skip
This file is no longer compiled to `src/interface.c`, has moved, and is in fact now translated.
Modified Paths:
--------------
po/POTFILES.skip
Modified: po/POTFILES.skip
2 lines changed, 0 insertions(+), 2 deletions(-)
===================================================================
@@ -2,8 +2,6 @@
# geany.desktop.in will be translated
geany.desktop.in
-# generated src/interface.c will be translated
-geany.glade
# no need to translate these files
plugins/demoplugin.c
plugins/demoproxy.c
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Sat, 05 Sep 2020 13:07:27 UTC
Commit: d2728e96719cfb6429f7a32b2a31e16d0ea1c62c
https://github.com/geany/www.geany.org/commit/d2728e96719cfb6429f7a32b2a31e…
Log Message:
-----------
Add 2020 Geany e.V. General Assembly meeting
Modified Paths:
--------------
page_content/association.md
Modified: page_content/association.md
10 lines changed, 9 insertions(+), 1 deletions(-)
===================================================================
@@ -11,7 +11,15 @@ There are no plans to direct the development of Geany itself from the associatio
#### Upcoming meetings
-* None planned
+##### Geany e.V. General Assembly 2020
+Date: 27th September 2020 - 15:00 CEST
+Location: Remote (via Jitsi)
+Audience: association members
+Agenda:
+
+* Election of the association board
+* General report
+* Financial report
#### Past meetings
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).