summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-10-27 14:07:53 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-10-27 14:07:53 (GMT)
commit11892ecd6dcf8714aa19b9f09c1cbcaa235e2743 (patch)
treecf0fa152f408f6174060bc3708fe429a4cc43de4
parent98779e0e36777dc6fe2f7e03b1059cd6a3ff1c76 (diff)
downloadcpython-11892ecd6dcf8714aa19b9f09c1cbcaa235e2743.zip
cpython-11892ecd6dcf8714aa19b9f09c1cbcaa235e2743.tar.gz
cpython-11892ecd6dcf8714aa19b9f09c1cbcaa235e2743.tar.bz2
Patch #817854: Add missing operations for SSLFile. Fixes #792101.
Backported to 2.3.
-rw-r--r--Lib/httplib.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index 03adb43..9832e47 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -910,6 +910,31 @@ class SSLFile(SharedSocketClient):
self._buf = all[i:]
return line
+ def readlines(self, sizehint=0):
+ total = 0
+ list = []
+ while True:
+ line = self.readline()
+ if not line:
+ break
+ list.append(line)
+ total += len(line)
+ if sizehint and total >= sizehint:
+ break
+ return list
+
+ def fileno(self):
+ return self._sock.fileno()
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ line = self.readline()
+ if not line:
+ raise StopIteration
+ return line
+
class FakeSocket(SharedSocketClient):
class _closedsocket: