[Github-comments] [geany/geany] Windows: Make TCP socket port number configurable (#2585)
Matthew Brush
notifications at xxxxx
Sun Sep 13 16:57:36 UTC 2020
@codebrainz commented on this pull request.
> + 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);
Would it be worth putting something like below to validate the port number?
```c
g_return_val_if_fail(port_number > 1024 && port_number <= (gint)G_MAXUINT16, SOCKET_WINDOWS_REMOTE_CMD_PORT);
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2585#pullrequestreview-487323419
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20200913/da2dfb58/attachment.htm>
More information about the Github-comments
mailing list