Commit 13aa0907 authored by Denis Bilenko's avatar Denis Bilenko

ssl: fix sendto/recvfrom/recfrom_into to pass the arguments as is to underlying socket object

parent 94276e4f
...@@ -208,12 +208,12 @@ class SSLSocket(socket): ...@@ -208,12 +208,12 @@ class SSLSocket(socket):
return socket.send(self, data, flags, timeout) return socket.send(self, data, flags, timeout)
# is it possible for sendall() to send some data without encryption if another end shut down SSL? # is it possible for sendall() to send some data without encryption if another end shut down SSL?
def sendto(self, data, addr, flags=0): def sendto(self, *args):
if self._sslobj: if self._sslobj:
raise ValueError("sendto not allowed on instances of %s" % raise ValueError("sendto not allowed on instances of %s" %
self.__class__) self.__class__)
else: else:
return socket.sendto(self, data, addr, flags) return socket.sendto(self, *args)
def recv(self, buflen=1024, flags=0): def recv(self, buflen=1024, flags=0):
if self._sslobj: if self._sslobj:
...@@ -274,19 +274,19 @@ class SSLSocket(socket): ...@@ -274,19 +274,19 @@ class SSLSocket(socket):
else: else:
return socket.recv_into(self, buffer, nbytes, flags) return socket.recv_into(self, buffer, nbytes, flags)
def recvfrom(self, addr, buflen=1024, flags=0): def recvfrom(self, *args):
if self._sslobj: if self._sslobj:
raise ValueError("recvfrom not allowed on instances of %s" % raise ValueError("recvfrom not allowed on instances of %s" %
self.__class__) self.__class__)
else: else:
return socket.recvfrom(self, addr, buflen, flags) return socket.recvfrom(self, *args)
def recvfrom_into(self, buffer, nbytes=None, flags=0): def recvfrom_into(self, *args):
if self._sslobj: if self._sslobj:
raise ValueError("recvfrom_into not allowed on instances of %s" % raise ValueError("recvfrom_into not allowed on instances of %s" %
self.__class__) self.__class__)
else: else:
return socket.recvfrom_into(self, buffer, nbytes, flags) return socket.recvfrom_into(self, *args)
def pending(self): def pending(self):
if self._sslobj: if self._sslobj:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment