Skip to content

Instantly share code, notes, and snippets.

@barik
barik / DelphiSwitchToFiber.pas
Created July 28, 2023 18:55 — forked from jsbattig/DelphiSwitchToFiber.pas
Unit to properly SwitchToFiber() in Delphi without breaking exception handling
{
The idea of DelphiSwitchToFiber() function is to backup on a local variable in stack the
state of the Exception stack right before calling SwitchToFiber() and then restoring its state
right atfer returns from call to SwitchToFiber().
If SwitchToFiber() is used directly from within an Except or Finally block, and if there's an exception
raised after switching to another fiber, upon coming back the results will be unpredictable because
the exception stack will be completely unwinded and all raise exceptions destroyed.
In order to prevent this issue we must backup the Exception stack before the call to SwitchToFiber()
and restore it right after the call.
@barik
barik / gist:1f6f4c7a505d6c29e080
Created December 31, 2015 03:20 — forked from mrtimp/gist:6987519
Cisco IOS IPsec/L2TP VPN
!
aaa new-model
!
!
aaa authentication login VPN local
aaa authorization network VPN local
!
!
vpdn enable
!