Re: [Openvpn-devel] [PATCH] interactive.c: remove unused function

2020-02-29 Thread Selva Nair
Hi,

On Sat, Feb 29, 2020 at 7:36 AM Lev Stipakov  wrote:
>
> From: Lev Stipakov 
>
> Function ReturnOpenvpnOutput was used to read
> openvpn process output and write it to openvpn-gui.
>
> Commit 852f1e4 has directed stdout/stderr streams of openvpn
> process to NUL, after which ReturnOpenvpnOutput() has become unused.
>
> Signed-off-by: Lev Stipakov 
> ---
>  src/openvpnserv/interactive.c | 25 -
>  1 file changed, 25 deletions(-)
>
> diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
> index 8da49be6..1f13163e 100644
> --- a/src/openvpnserv/interactive.c
> +++ b/src/openvpnserv/interactive.c
> @@ -361,31 +361,6 @@ ReturnLastError(HANDLE pipe, LPCWSTR func)
>  ReturnError(pipe, GetLastError(), func, 1, _event);
>  }
>
> -
> -static VOID
> -ReturnOpenvpnOutput(HANDLE pipe, HANDLE ovpn_output, DWORD count, LPHANDLE 
> events)
> -{
> -WCHAR *wide_output = NULL;
> -CHAR output[512];
> -DWORD size;
> -
> -ReadFile(ovpn_output, output, sizeof(output), , NULL);
> -if (size == 0)
> -{
> -return;
> -}
> -
> -wide_output = malloc((size) * sizeof(WCHAR));
> -if (wide_output)
> -{
> -MultiByteToWideChar(CP_UTF8, 0, output, size, wide_output, size);
> -wide_output[size - 1] = 0;
> -}
> -
> -ReturnError(pipe, ERROR_OPENVPN_STARTUP, wide_output, count, events);
> -free(wide_output);
> -}
> -
>  /*
>   * Validate options against a white list. Also check the config_file is
>   * inside the config_dir. The white list is defined in validate.c

Makes sense to get rid of this unused static function.
Compile tested.

Acked-by: 


___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel


[Openvpn-devel] [PATCH] interactive.c: remove unused function

2020-02-29 Thread Lev Stipakov
From: Lev Stipakov 

Function ReturnOpenvpnOutput was used to read
openvpn process output and write it to openvpn-gui.

Commit 852f1e4 has directed stdout/stderr streams of openvpn
process to NUL, after which ReturnOpenvpnOutput() has become unused.

Signed-off-by: Lev Stipakov 
---
 src/openvpnserv/interactive.c | 25 -
 1 file changed, 25 deletions(-)

diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 8da49be6..1f13163e 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -361,31 +361,6 @@ ReturnLastError(HANDLE pipe, LPCWSTR func)
 ReturnError(pipe, GetLastError(), func, 1, _event);
 }
 
-
-static VOID
-ReturnOpenvpnOutput(HANDLE pipe, HANDLE ovpn_output, DWORD count, LPHANDLE 
events)
-{
-WCHAR *wide_output = NULL;
-CHAR output[512];
-DWORD size;
-
-ReadFile(ovpn_output, output, sizeof(output), , NULL);
-if (size == 0)
-{
-return;
-}
-
-wide_output = malloc((size) * sizeof(WCHAR));
-if (wide_output)
-{
-MultiByteToWideChar(CP_UTF8, 0, output, size, wide_output, size);
-wide_output[size - 1] = 0;
-}
-
-ReturnError(pipe, ERROR_OPENVPN_STARTUP, wide_output, count, events);
-free(wide_output);
-}
-
 /*
  * Validate options against a white list. Also check the config_file is
  * inside the config_dir. The white list is defined in validate.c
-- 
2.17.1



___
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel