Skip to content

Commit

Permalink
Provide more info when short packets are received
Browse files Browse the repository at this point in the history
  • Loading branch information
Elric Milon authored and pimveldhuisen committed Apr 25, 2016
1 parent c565381 commit 37636db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion candidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_member(self):
return self._association

def __str__(self):
return "{%s:%d}" % self._sock_addr
return "<Candidate %s:%d>" % self._sock_addr

def __eq__(self, other):
"""
Expand Down
3 changes: 2 additions & 1 deletion dispersy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,8 @@ def on_incoming_packets(self, packets, cache=True, timestamp=0.0, source=u"unkno
assert all(isinstance(packet[0], Candidate) for packet in packets), packets
assert all((is_valid_address(packet[0].sock_addr) for packet in packets)), packets
assert all(isinstance(packet[1], str) for packet in packets), packets
assert all(len(packet[1]) > 22 for packet in packets), packets
assert all(len(packet[1]) > 22 for packet in packets), [
(str(packet[0]), repr(packet[1])) for packet in packets]
assert isinstance(cache, bool), cache
assert isinstance(timestamp, float), timestamp
assert isinstance(source, unicode), source
Expand Down

0 comments on commit 37636db

Please sign in to comment.