From d9f440cc08bc7c2322cf7c00359ceeeabe00cf54 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Thu, 24 Sep 2009 16:19:03 +0200 Subject: [PATCH] [entropy.services.ugc] make socket setup fault tolerant --- libraries/entropy/services/ugc/interfaces.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/entropy/services/ugc/interfaces.py b/libraries/entropy/services/ugc/interfaces.py index 9bb8e1b56..888b1d57f 100644 --- a/libraries/entropy/services/ugc/interfaces.py +++ b/libraries/entropy/services/ugc/interfaces.py @@ -2214,6 +2214,11 @@ class Client: # Moved here because setblocking resets the given timeout on # connect() causing connection test to hang self.real_sock_conn.setblocking(True) + # re-set timeout again, this workarounds the famous bug + # that caused UGC to not being able to send large amount + # of data + if hasattr(self.real_sock_conn,'settimeout'): + self.real_sock_conn.settimeout(self.socket_timeout) if not self.quiet: mytxt = _("Successfully connected to host")