diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-01-13 13:56:07 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-01-13 13:57:29 +0100 |
| commit | 26abec61db10c3b86d9d168f093d4e5a75cc8783 (patch) | |
| tree | e25f7c2b4329a079f1ef3cb25a74dd008723cbbe | |
| parent | 6cc203262756c61288822846d86032ae6bf58dc7 (diff) | |
Server API: Set a lower timeout for disconnect
| -rw-r--r-- | internal/server/api.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/server/api.go b/internal/server/api.go index 1ac3164..d65e923 100644 --- a/internal/server/api.go +++ b/internal/server/api.go @@ -201,6 +201,8 @@ func APIConnectOpenVPN(srv Server, profileID string, preferTCP bool) (string, ti // APIDisconnect disconnects from the API. func APIDisconnect(server Server) error { - _, _, err := apiAuthorized(server, http.MethodPost, "/disconnect", nil) + // The timeout is a bit lower here such that this does not take a too long time for disconnecting + // Clients may wish to retry this + _, _, err := apiAuthorized(server, http.MethodPost, "/disconnect", &httpw.OptionalParams{Timeout: 5 * time.Second}) return err } |
