Object sending efficiency improvement
This commit is contained in:
parent
d4f5d370d4
commit
dbd1515ae8
|
@ -263,6 +263,8 @@ class Connection(threading.Thread):
|
||||||
to_get = inv.vectors.copy()
|
to_get = inv.vectors.copy()
|
||||||
to_get.difference_update(shared.objects.keys())
|
to_get.difference_update(shared.objects.keys())
|
||||||
self.vectors_to_get.update(to_get)
|
self.vectors_to_get.update(to_get)
|
||||||
|
# Do not send objects they already have.
|
||||||
|
self.vectors_to_send.difference_update(inv.vectors)
|
||||||
elif m.command == b'object':
|
elif m.command == b'object':
|
||||||
obj = structure.Object.from_message(m)
|
obj = structure.Object.from_message(m)
|
||||||
logging.debug('{}:{} -> {}'.format(self.host, self.port, obj))
|
logging.debug('{}:{} -> {}'.format(self.host, self.port, obj))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user