goagent/goagent — pull request #40 by bruiselee (2012-12-02 10:37:06+00:00)
Title: fix PAAS client-side error for handling Transfer-Encoding:chunked

wired pages like news.backchina.com use http header "Transfer-Encoding:chunked" but not act as RFC's require -- they just send the normal http body segmented in TCP, not in HTTP, which make PAAS_handler in proxy.py fail to work, I found the problem by wireshark.

the chuck-size call of "count = int(line,16)" just throws exception

so I add a check: if the length of "line" is less than 5 (64K max size for a chunk), then it is a real chunk, or else a normal http body without content-length header.