Permalink
Browse files

Fix the code for printing bad data

  • Loading branch information...
1 parent e69ef33 commit 8ea4d4178e2ac0c13bc1fc3d2aa7d53454945488 @priteau priteau committed Aug 10, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lantorrent/pylantorrent/ltConnection.py
@@ -116,10 +116,10 @@ def send(self, data):
self.valid = False
self.ex = LTException(506, "%s:%s %s" % (self.host, str(self.port), str(ex)), self.host, self.port, self.requests)
pylantorrent.log(logging.WARNING, "send error " + str(self.ex), traceback)
- data = self._read_from_socket()
- while(data):
- pylantorrent.log(logging.WARNING, "bad data s" + str(data))
- data = self._read_from_socket()
+ data = self._read_from_socket(self.read_buffer_len)
+ while data:
+ pylantorrent.log(logging.WARNING, "bad data: " + str(data))
+ data = self._read_from_socket(self.read_buffer_len)
j = self.ex.get_json()
s = json.dumps(j)
self.output_printer.print_results(s)

0 comments on commit 8ea4d41

Please sign in to comment.