On 6/24/19 4:37 PM, Jussi Laakkonen wrote:
The connection callback (connect_cb()) can be called via vpn-agent.c
indicate that VPN agent dialog had an error or was cancelled in addition
to calling the function via VPN plugin. Because of this the different
error types should be handled properly.
- EACCES is an authentication error: VPN_PROVIDER_ERROR_AUTH_FAILED.
- ENOMSG and ETIMEDOUT are system reported errors and then the agent
request needs to be canceled and error set unknown error.
- ECANCELED is reported when user canceled VPN agent dialog, treat this
as same as ECONNABORTED as the VPN may have been initialized already.
- ECONNABORTED is set when connect_cb() is called via VPN plugin. To
ensure that proper disconnect -> idle cycle is done both driver and
provider are set to disconnect state and eventually killed and put to
idle state if the provider was 1) being connected or 2) already
- In other cases the VPN provider is set to failure state and connect
error is indicated.
Patch applied. I tried to come up with a better indention but failed ...