summaryrefslogtreecommitdiffstats
path: root/Lib/ssl.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2011-08-22 01:55:57 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2011-08-22 01:55:57 (GMT)
commit96fe56abec36d2cb82c56c9ddafea0096f4f6c7e (patch)
treefa5e6293d1fc1cc00b41c57cd192df49a6a6b7ff /Lib/ssl.py
parent8983729dc08a05d5419d35ec3f431c7b442401a6 (diff)
downloadcpython-96fe56abec36d2cb82c56c9ddafea0096f4f6c7e.zip
cpython-96fe56abec36d2cb82c56c9ddafea0096f4f6c7e.tar.gz
cpython-96fe56abec36d2cb82c56c9ddafea0096f4f6c7e.tar.bz2
Add support for the send/recvmsg API to the socket module. Patch by David Watson and Heiko Wundram. (Closes #6560)
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r--Lib/ssl.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index 914e749..1b7416e 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -355,6 +355,14 @@ class SSLSocket(socket):
else:
return socket.sendto(self, data, flags_or_addr, addr)
+ def sendmsg(self, *args, **kwargs):
+ self._checkClosed()
+ if self._sslobj:
+ raise ValueError("sendmsg not allowed on instances of %s" %
+ self.__class__)
+ else:
+ return socket.sendmsg(self, *args, **kwargs)
+
def sendall(self, data, flags=0):
self._checkClosed()
if self._sslobj:
@@ -413,6 +421,22 @@ class SSLSocket(socket):
else:
return socket.recvfrom_into(self, buffer, nbytes, flags)
+ def recvmsg(self, *args, **kwargs):
+ self._checkClosed()
+ if self._sslobj:
+ raise ValueError("recvmsg not allowed on instances of %s" %
+ self.__class__)
+ else:
+ return socket.recvmsg(self, *args, **kwargs)
+
+ def recvmsg_into(self, *args, **kwargs):
+ self._checkClosed()
+ if self._sslobj:
+ raise ValueError("recvmsg_into not allowed on instances of %s" %
+ self.__class__)
+ else:
+ return socket.recvmsg_into(self, *args, **kwargs)
+
def pending(self):
self._checkClosed()
if self._sslobj: