On Sat, Feb 22, 2003 at 01:19:18PM -0500, Gianni Johansson wrote: > Hi Fish: > What was the bug that you found in my FCP FEC python test scripts again?
Cut and paste from the email of the day (I forget any details I didn't write
down, sorry ^_^):
line #664 of FCP.py reads:
while msg != None:
#print "msg: " + msg[0]
if msg[0] == 'DataChunk':
length = int(msg[1]['Length'], 16)
while length > 0:
boundry = (blockNum + 1) * checkBlockSize
if count < boundry:
# Read into the current block
nBytes = boundry - count
if nBytes > length:
nBytes = length
nRead = copy_binary(file, nBytes,
currentFile)
if nRead != nBytes:
print "Didn't read enough
bytes!"
print "nRead: ", nRead,
" nBytes: ", nBytes
raise IOError
count += nRead
length -= nRead
else:
# Advance to the next block
currentFile.close()
blockNum = blockNum + 1
currentFile =
open(checkBlockFileNames[blockNum], "w")
msg = read_message(file)
else:
print "Received an unexpected msg:", msg
return 0
The part in "if count < boundry" will not be executed for the final block,
as far as I can tell - at least, it didn't in my implentation of the same
thing.
- fish
pgp00000.pgp
Description: PGP signature
