From: Heiko Hund <[email protected]>

If creating the next client pipe instance failed, the service stopped.

Drop the client and keep listening on the current instance instead.
Handing it to a worker would leave no instance to listen on.

Change-Id: Ib65ceb898d23777663c32241156d597918a24ffb
Signed-off-by: Heiko Hund <[email protected]>
Acked-by: Frank Lichtenheld <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2114
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2114
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]>

        
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index bffc9da..37e8667 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -4087,6 +4087,16 @@
         {
             /* Client connected, spawn a worker thread for it */
             HANDLE next_pipe = CreateClientPipeInstance();
+            if (next_pipe == INVALID_HANDLE_VALUE)
+            {
+                /*
+                 * Drop the client and keep listening on this instance. Handing
+                 * it over would leave no instance to listen on.
+                 */
+                DisconnectNamedPipe(pipe);
+                ResetOverlapped(&overlapped);
+                continue;
+            }
 
             /* Avoid exceeding WaitForMultipleObjects MAXIMUM_WAIT_OBJECTS */
             if (handle_count + 1 > MAXIMUM_WAIT_OBJECTS)


_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to