Christian Heimes <[email protected]> added the comment:
That's a good idea, Ronald! socket.c:sock_send_impl() already clamps the input
length on Windows:
#ifdef MS_WINDOWS
if (ctx->len > INT_MAX)
ctx->len = INT_MAX;
ctx->result = send(s->sock_fd, ctx->buf, (int)ctx->len, ctx->flags);
#else
ctx->result = send(s->sock_fd, ctx->buf, ctx->len, ctx->flags);
#endif
I could implement a similar logic for SSLSocket. Applications have to check the
return value of send() any way or use sendall(). The socket.send() method /
send(2) libc function may also write less bytes.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42853>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com