Show More
@@ -349,7 +349,7 b' class HTTPHandler(KeepAliveHandler, urlr' | |||
|
349 | 349 | |
|
350 | 350 | class HTTPResponse(httplib.HTTPResponse): |
|
351 | 351 | # we need to subclass HTTPResponse in order to |
|
352 |
# 1) add readline() and read |
|
|
352 | # 1) add readline(), readlines(), and readinto() methods | |
|
353 | 353 | # 2) add close_connection() methods |
|
354 | 354 | # 3) add info() and geturl() methods |
|
355 | 355 | |
@@ -522,6 +522,14 b' class HTTPResponse(httplib.HTTPResponse)' | |||
|
522 | 522 | break |
|
523 | 523 | return list |
|
524 | 524 | |
|
525 | def readinto(self, dest): | |
|
526 | res = self.read(len(dest)) | |
|
527 | if not res: | |
|
528 | return 0 | |
|
529 | ||
|
530 | dest[0:len(res)] = res | |
|
531 | return len(res) | |
|
532 | ||
|
525 | 533 | def safesend(self, str): |
|
526 | 534 | """Send `str' to the server. |
|
527 | 535 |
General Comments 0
You need to be logged in to leave comments.
Login now