Re: [Openvpn-devel] [PATCH] Fix handling of out of memory error in interactive service

2016-05-22 Thread Selva Nair
On Sun, May 22, 2016 at 12:56 PM, Gert Doering wrote: > Mmmh, anyway, I have two options now :-) - ask you for a v2 that is > MSVC 2010 compatible, and has the initial value reverted to "10", or > just apply... > Let's make life easy -- will do a v2 with both those changes:-) and just hope if/wh

Re: [Openvpn-devel] [PATCH] Fix handling of out of memory error in interactive service

2016-05-22 Thread Gert Doering
Hi, On Sun, May 22, 2016 at 11:00:22AM -0400, Selva Nair wrote: > > On Sun, May 22, 2016 at 12:46:27AM -0400, Selva Nair wrote: > > > { > > >size += 10; > > > - handles = realloc (handles, size * sizeof (HANDLE)); > > > - if (handles == NULL) > > > -

Re: [Openvpn-devel] [PATCH] Fix handling of out of memory error in interactive service

2016-05-22 Thread Selva Nair
copy to the list... On Sun, May 22, 2016 at 3:31 AM, Gert Doering wrote: > Hi, > > On Sun, May 22, 2016 at 12:46:27AM -0400, Selva Nair wrote: > > { > >size += 10; > > - handles = realloc (handles, size * sizeof (HANDLE)); > > - if (handles == NULL) > > -

Re: [Openvpn-devel] [PATCH] Fix handling of out of memory error in interactive service

2016-05-22 Thread Selva Nair
Hi, Thanks for the comments. On Sun, May 22, 2016 at 3:26 AM, Gert Doering wrote: > thanks for digging into this. Overall, the patch makes sense, I'm just > wondering about this: > > On Sun, May 22, 2016 at 12:46:27AM -0400, Selva Nair wrote: > > Other changes: > > - Use minimal initial alloca

Re: [Openvpn-devel] [PATCH] Fix handling of out of memory error in interactive service

2016-05-22 Thread Gert Doering
Hi, On Sun, May 22, 2016 at 12:46:27AM -0400, Selva Nair wrote: > { >size += 10; > - handles = realloc (handles, size * sizeof (HANDLE)); > - if (handles == NULL) > -return ERROR_OUTOFMEMORY; > + LPHANDLE tmp = realloc (handles, size * si

Re: [Openvpn-devel] [PATCH] Fix handling of out of memory error in interactive service

2016-05-22 Thread Gert Doering
Hi, thanks for digging into this. Overall, the patch makes sense, I'm just wondering about this: On Sun, May 22, 2016 at 12:46:27AM -0400, Selva Nair wrote: > Other changes: > - Use minimal initial allocation size so that the realloc code path > gets exercised (2 or more connections will cause

[Openvpn-devel] [PATCH] Fix handling of out of memory error in interactive service

2016-05-22 Thread Selva Nair
Currently realloc failure in UpdateWaitHandles() is handled by triggering exit_event and waiting for all active worker threads to terminate. However, at this point the wait handles array will contain an invalid value (handle of the latest thread that is terminated), causing a cycle of WAIT_FAILED <