catch ValueError, raise IncompleteRead on invalid chunk length

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1250 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2004-02-19 23:13:30 +00:00
parent 9e65a336ef
commit fefba0036d

View file

@ -423,7 +423,10 @@ class HTTPResponse:
i = line.find(';')
if i >= 0:
line = line[:i] # strip chunk-extensions
chunk_left = int(line, 16)
try:
chunk_left = int(line, 16)
except ValueError, msg:
raise IncompleteRead(msg)
if chunk_left == 0:
break
if amt is None: