From: Thomas Veerman Content-Type: multipart/alternative; boundary="Apple-Mail=_2CABCE6B-CB85-4172-90CA-3EFDF8D1807A" Message-Id: <3F074630-6731-43EB-BD03-E6A331FC3109@...1862...> Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Date: Wed, 22 Jan 2014 10:28:30 +0100 References: In-Reply-To: Subject: Re: [Openvpn-devel] [PATCH] Update expiry date in management event loop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: openvpn-devel@lists.sourceforge.net --Apple-Mail=_2CABCE6B-CB85-4172-90CA-3EFDF8D1807A Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The condition under which I encountered this was trying to set up a connect= ion using "tcp-client" and then querying the management console every 500 m= illiseconds for the connection state. This would never proceed beyond TCP_C= ONNECT. If you query less than once per second it works fine. When connecting with TCP, the code does a non-blocking connect. When you co= nnect using UDP, you take a different path which does in fact update the ex= piry timer correctly. -- Thomas On Jan 22, 2014, at 9:27 AM, Thomas Veerman wro= te: > When there are events from the management console with an interval shorter > than 1 second, the event loop never stops as it keeps resetting event_wai= t. > --- > src/openvpn/manage.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c > index 22dbe13..42a87c2 100644 > --- a/src/openvpn/manage.c > +++ b/src/openvpn/manage.c > @@ -2922,7 +2922,8 @@ management_event_loop_n_seconds (struct management = *man, int sec) > man_check_for_signals (&signal_received); > if (signal_received) > return; > - } while (expire); > + update_time(); > + } while (expire && expire > now); >=20=20 > /* revert state */ > man->persist.standalone_disabled =3D standalone_disabled_save; > --=20 > 1.7.12.4 (Apple Git-37) >=20 > -------------------------------------------------------------------------= ----- > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today.=20 > http://pubads.g.doubleclick.net/gampad/clk?id=3D119420431&iu=3D/4140/ostg= .clktrk_______________________________________________ > Openvpn-devel mailing list > Openvpn-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/openvpn-devel --Apple-Mail=_2CABCE6B-CB85-4172-90CA-3EFDF8D1807A Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
When connecting with TCP, the code does a non-blocking connect. Whe= n you connect using UDP, you take a different path which does in fact updat= e the expiry timer correctly.

--
Thomas<= /div>

On Jan 22, 2014, at 9:27 AM, Thomas Veerman &= lt;thomas.veerman@...1862...> wrote:


= --Apple-Mail=_2CABCE6B-CB85-4172-90CA-3EFDF8D1807A--