* Fix copy-paste error ("output" should be "input")

* Stop decoding as soon as an error is encountered


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7220 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2009-04-27 23:48:50 +00:00 committed by Git SVN Gateway
parent b0c5590f6c
commit b5e6967f73
1 changed files with 5 additions and 2 deletions

View File

@ -79,7 +79,7 @@ def readable(input):
else:
try:
# Socket IO
io = output.makefile()
io = input.makefile()
yield io
except AttributeError:
# String IO (no, not the StringIO class, that would have been matched as "File IO")
@ -229,7 +229,10 @@ class BinaryProtocol20(BaseProtocol):
(count,) = self.countFormat.unpack_from(input)
for i in xrange(count):
yield self.decodeSingle(read or input, offset=(self.size * i + self.countFormat.size))
game = self.decodeSingle(read or input, offset=(self.size * i + self.countFormat.size))
if game is None:
return
yield game
class BinaryProtocol21(BinaryProtocol20):
lobbyPort = BaseProtocol.lobbyPort['2.1']