[pypy-commit] pypy strbuf-as-buffer: provide the length as parameter to sendto in rlib/rsocket.py

plan_rich pypy.commits at gmail.com
Thu Dec 8 09:07:50 EST 2016


Author: Richard Plangger <planrichi at gmail.com>
Branch: strbuf-as-buffer
Changeset: r88970:5b624c957ac2
Date: 2016-12-08 15:07 +0100
http://bitbucket.org/pypy/pypy/changeset/5b624c957ac2/

Log:	provide the length as parameter to sendto in rlib/rsocket.py

diff --git a/pypy/module/_socket/interp_socket.py b/pypy/module/_socket/interp_socket.py
--- a/pypy/module/_socket/interp_socket.py
+++ b/pypy/module/_socket/interp_socket.py
@@ -424,7 +424,7 @@
             w_addr = w_param3
         try:
             addr = self.addr_from_object(space, w_addr)
-            count = self.sock.sendto(data, flags, addr)
+            count = self.sock.sendto(data, len(data), flags, addr)
         except SocketError as e:
             raise converted_error(space, e)
         return space.wrap(count)
diff --git a/rpython/rlib/rsocket.py b/rpython/rlib/rsocket.py
--- a/rpython/rlib/rsocket.py
+++ b/rpython/rlib/rsocket.py
@@ -997,12 +997,12 @@
                 if signal_checker is not None:
                     signal_checker()
 
-    def sendto(self, data, flags, address):
+    def sendto(self, data, length, flags, address):
         """Like send(data, flags) but allows specifying the destination
         address.  (Note that 'flags' is mandatory here.)"""
         self.wait_for_data(True)
         addr = address.lock()
-        res = _c.sendto(self.fd, data, len(data), flags,
+        res = _c.sendto(self.fd, data, length, flags,
                         addr, address.addrlen)
         address.unlock()
         if res < 0:


More information about the pypy-commit mailing list