[Spice-devel] [PATCH spice-xpi 1/2] controller: try connection every second

Christophe Fergeau cfergeau at redhat.com
Thu Mar 13 10:01:55 PDT 2014


On Fri, Mar 07, 2014 at 03:02:40PM +0100, Marc-André Lureau wrote:
> From: Marc-André Lureau <marcandre.lureau at gmail.com>
> 
> 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.

Why not, ACK

Christophe

> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1073461
> ---
>  SpiceXPI/src/plugin/controller.cpp | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/SpiceXPI/src/plugin/controller.cpp b/SpiceXPI/src/plugin/controller.cpp
> index ac97ce1..bdfcba8 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");
> -- 
> 1.8.5.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20140313/5c749693/attachment-0001.pgp>


More information about the Spice-devel mailing list