From 11892ecd6dcf8714aa19b9f09c1cbcaa235e2743 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= <martin@v.loewis.de>
Date: Mon, 27 Oct 2003 14:07:53 +0000
Subject: Patch #817854: Add missing operations for SSLFile. Fixes #792101.
 Backported to 2.3.

---
 Lib/httplib.py | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

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:
-- 
cgit v0.12

