Merge pull request #10 from zeronet-conservancy/fix_tracker_onion_v3
Fix onion v3 trackers
This commit is contained in:
commit
af426cba98
2 changed files with 3 additions and 2 deletions
|
@ -124,7 +124,7 @@ class SiteAnnouncerPlugin(object):
|
||||||
sign = CryptRsa.sign(res["onion_sign_this"].encode("utf8"), self.site.connection_server.tor_manager.getPrivatekey(onion))
|
sign = CryptRsa.sign(res["onion_sign_this"].encode("utf8"), self.site.connection_server.tor_manager.getPrivatekey(onion))
|
||||||
request["onion_signs"][publickey] = sign
|
request["onion_signs"][publickey] = sign
|
||||||
res = tracker_peer.request("announce", request)
|
res = tracker_peer.request("announce", request)
|
||||||
if not res or "onion_sign_this" in res:
|
if not res:
|
||||||
if full_announce:
|
if full_announce:
|
||||||
time_full_announced[tracker_address] = 0
|
time_full_announced[tracker_address] = 0
|
||||||
raise AnnounceError("Announce onion address to failed: %s" % res)
|
raise AnnounceError("Announce onion address to failed: %s" % res)
|
||||||
|
|
|
@ -157,10 +157,11 @@ class Peer(object):
|
||||||
for retry in range(1, 4): # Retry 3 times
|
for retry in range(1, 4): # Retry 3 times
|
||||||
try:
|
try:
|
||||||
if not self.connection:
|
if not self.connection:
|
||||||
|
# this is redundant, already established that self.connection is present
|
||||||
raise Exception("No connection found")
|
raise Exception("No connection found")
|
||||||
res = self.connection.request(cmd, params, stream_to)
|
res = self.connection.request(cmd, params, stream_to)
|
||||||
if not res:
|
if not res:
|
||||||
raise Exception("Send error")
|
raise Exception("Send error: result is empty")
|
||||||
if "error" in res:
|
if "error" in res:
|
||||||
self.log("%s error: %s" % (cmd, res["error"]))
|
self.log("%s error: %s" % (cmd, res["error"]))
|
||||||
self.onConnectionError("Response error")
|
self.onConnectionError("Response error")
|
||||||
|
|
Loading…
Reference in a new issue