diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2014-03-07 14:57:42 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2014-06-03 17:45:55 +0200 |
commit | 453f0deb5c42d06c61ef28c3578a700ce9e6d69d (patch) | |
tree | 96d1d55aa90cc3f10da0f33b86e01164b71dc936 /SpiceXPI/src/plugin/controller.cpp | |
parent | 3ede7323a5f84cb3e02883b1282b9358a760d317 (diff) |
controller: try connection every second
Currently, with 10 tries, it takes up to n(n+1)/2 = 55s before
returning failure.
The default firefox plugin timeout is 45s, passed that time, the plugin
is killed. 10s should be enough in normal usage for the client to setup
the unix socket.
https://bugzilla.redhat.com/show_bug.cgi?id=1073461
Diffstat (limited to 'SpiceXPI/src/plugin/controller.cpp')
-rw-r--r-- | SpiceXPI/src/plugin/controller.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/SpiceXPI/src/plugin/controller.cpp b/SpiceXPI/src/plugin/controller.cpp index e787012..988768b 100644 --- a/SpiceXPI/src/plugin/controller.cpp +++ b/SpiceXPI/src/plugin/controller.cpp @@ -88,14 +88,13 @@ void SpiceController::SetProxy(const std::string &proxy) int SpiceController::Connect(const int nRetries) { int rc = -1; - int sleep_time = 0; + int sleep_time = 1; // try to connect for specified count for (int i = 0; rc != 0 && i < nRetries; ++i) { rc = Connect(); g_usleep(sleep_time * G_USEC_PER_SEC); - ++sleep_time; } if (rc != 0) { g_warning("error connecting"); |