From 0b340b784cd2d6f0a1deff239dac58d029195e60 Mon Sep 17 00:00:00 2001 From: kubistika Date: Sun, 8 Sep 2019 18:13:41 +0300 Subject: [PATCH] server: proxy: drop local unix socket listen option --- server/proxy/pf_config.c | 1 - server/proxy/pf_config.h | 1 - server/proxy/pf_server.c | 27 +-------------------------- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/server/proxy/pf_config.c b/server/proxy/pf_config.c index 625dd21..dd8af9b 100644 --- a/server/proxy/pf_config.c +++ b/server/proxy/pf_config.c @@ -69,7 +69,6 @@ static BOOL pf_config_get_uint32(wIniFile* ini, const char* section, const char* static BOOL pf_config_load_server(wIniFile* ini, proxyConfig* config) { config->Host = _strdup(CONFIG_GET_STR(ini, "Server", "Host")); - config->LocalOnly = CONFIG_GET_BOOL(ini, "Server", "LocalOnly"); if (!pf_config_get_uint16(ini, "Server", "Port", &config->Port)) return FALSE; diff --git a/server/proxy/pf_config.h b/server/proxy/pf_config.h index 105b44d..b42f2f7 100644 --- a/server/proxy/pf_config.h +++ b/server/proxy/pf_config.h @@ -33,7 +33,6 @@ struct proxy_config /* server */ char* Host; UINT16 Port; - BOOL LocalOnly; /* target */ BOOL UseLoadBalanceInfo; diff --git a/server/proxy/pf_server.c b/server/proxy/pf_server.c index d5080b5..fdfe3b9 100644 --- a/server/proxy/pf_server.c +++ b/server/proxy/pf_server.c @@ -397,9 +397,6 @@ static void pf_server_mainloop(freerdp_listener* listener) int pf_server_start(proxyConfig* config) { - char* localSockPath; - char localSockName[MAX_PATH]; - BOOL success; WSADATA wsaData; freerdp_listener* listener = freerdp_listener_new(); @@ -417,33 +414,11 @@ int pf_server_start(proxyConfig* config) return -1; } - /* Determine filepath for local socket */ - sprintf_s(localSockName, sizeof(localSockName), "proxy.%" PRIu16 "", config->Port); - localSockPath = GetKnownSubPath(KNOWN_PATH_TEMP, localSockName); - - if (!localSockPath) - { - freerdp_listener_free(listener); - WSACleanup(); - return -1; - } - - /* Listen to local connections */ - success = listener->OpenLocal(listener, localSockPath); - - /* Listen to remote connections */ - if (!config->LocalOnly) - { - success &= listener->Open(listener, config->Host, config->Port); - } - - if (success) + if (listener->Open(listener, config->Host, config->Port)) { pf_server_mainloop(listener); } - free(localSockPath); - freerdp_listener_free(listener); WSACleanup(); return 0; } -- 2.7.4