Coder Social home page Coder Social logo

Comments (7)

mattock avatar mattock commented on August 22, 2024

Maybe the pre-connect and disconnect script timeouts are there just because of symmetry ("connect scripts have timeout, so these should too". Force-termination of scripts, coupled with a high default timeout value that is user-configurable makes sense in my opinion.

from openvpn-gui.

chipitsine avatar chipitsine commented on August 22, 2024

why to have timeouts at both openvpn (config files) and openvpn-gui?
are there cases which cannot be resolved with timeouts specified at openvpn config files?

from openvpn-gui.

selvanair avatar selvanair commented on August 22, 2024

Took a while to get back to this topic. Thanks for the comments.
@chipitsine : this is for scripts run directly by the GUI which is different from up/down scripts run by openvpn.

I think we can improve the timeout handling as below:

  • preconnect_script: keep default timeout small (10s?), do not connect until script exits or times out, kill if still running, warn the user and proceed with the connection. The assumption is that the user wants this script to complete before connecting.
  • connect_script: have a long default timeout, let the script run in a separate thread and let die on timeout. timeout=0 interpreted as infinite (i.e. never kill). The idea is that this may involve tasks like mapping shared drives which can sometimes take a while but the GUI need not wait for it to complete.
  • disconnect_script: like the preconnect script this has to complete before disconnection so keep a small default timeout (10s?) and kill if not complete and then process the disconnection.

The main difference from the current behaviour would be (i) pre-connect and disconnect scripts are killed on timeout and (ii) connect script is not waited on. Also make sure windows events are handled during the wait so that the GUI doesn't appear to hang during the wait as it does now.

In the first and last cases the users who do not want the script to be killed can put the task into background and return promptly.

If this sounds sensible I'll make a patch.

from openvpn-gui.

mattock avatar mattock commented on August 22, 2024

@selvanair : as long as failed scripts create a warning this should improve things from user perspective, so a +1 for a patch.

from openvpn-gui.

selvanair avatar selvanair commented on August 22, 2024

Reviving this long forgotten thread in light of the recent thread on the users ML:
https://www.mail-archive.com/[email protected]/msg04367.html

In addition to what I had proposed we'd also need to treat preconnectscript failures as an error or have an option to do so.

from openvpn-gui.

TinCanTech avatar TinCanTech commented on August 22, 2024

Taking that email thread into account .. I think the pre-connect script should be able to terminate the attempt by the GUI to launch the openvpn binary with what ever config.
(That does not appear to have been made clear so far)

from openvpn-gui.

selvanair avatar selvanair commented on August 22, 2024

Yep. Had forgotten that crucial detail until I went back read what I wrote in this thread a long time ago :)

from openvpn-gui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.