Permalink
Browse files

some fixes for HttpTransport

  • Loading branch information...
1 parent 9d5f8e9 commit 7e2cb95fd39cf7653e2fa1c296660cd4571367f9 @m0mchil committed Sep 28, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 HttpTransport.py
View
@@ -135,7 +135,8 @@ def timeout_response(self, connection, timeout):
response = connection.getresponse()
except socket.timeout:
pass
- return response
+ connection.sock.settimeout(timeout)
+ return response
else:
return connection.getresponse()
@@ -148,6 +149,8 @@ def getwork(self, data=None):
self.servers.connection_ok()
return result['result']
+ except Exception:
+ say_exception()
except (IOError, httplib.HTTPException, ValueError, socks.ProxyError, NotAuthorized, RPCError):
self.stop()
@@ -156,6 +159,7 @@ def send_internal(self, result, nonce):
accepted = self.getwork(data)
if accepted != None:
self.servers.report(result.miner, nonce, accepted)
+ return True
def long_poll_thread(self):
last_host = None
@@ -216,7 +220,7 @@ def queue_work(self, work, miner=None):
if not 'target' in work:
work['target'] = '0000000000000000000000000000000000000000000000000000ffff00000000'
- self.servers.queue_work(self, work['data'], work['target'], miner)
+ self.servers.queue_work(self, work['data'], work['target'], miner=miner)
def detect_stratum(self):
work = self.getwork()

0 comments on commit 7e2cb95

Please sign in to comment.