Skip to content

Commit

Permalink
Revert "bpo-42854: Correctly use size_t for _ssl._SSLSocket.read and …
Browse files Browse the repository at this point in the history
…_ssl._SSLSocket.write (pythonGH-27271)"

This reverts commit 83d1430.
  • Loading branch information
tiran committed Aug 3, 2022
1 parent 72cad6c commit ca3d2be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2354,7 +2354,7 @@ _ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b)

do {
PySSL_BEGIN_ALLOW_THREADS
retval = SSL_write_ex(self->ssl, b->buf, (size_t)b->len, &count);
retval = SSL_write_ex(self->ssl, b->buf, (int)b->len, &count);
err = _PySSL_errno(retval == 0, self->ssl, retval);
PySSL_END_ALLOW_THREADS
self->err = err;
Expand Down Expand Up @@ -2427,7 +2427,7 @@ _ssl__SSLSocket_pending_impl(PySSLSocket *self)

/*[clinic input]
_ssl._SSLSocket.read
size as len: Py_ssize_t
size as len: int
[
buffer: Py_buffer(accept={rwbuffer})
]
Expand All @@ -2437,9 +2437,9 @@ Read up to size bytes from the SSL socket.
[clinic start generated code]*/

static PyObject *
_ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len,
int group_right_1, Py_buffer *buffer)
/*[clinic end generated code: output=49b16e6406023734 input=ec48bf622be1c4a1]*/
_ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1,
Py_buffer *buffer)
/*[clinic end generated code: output=00097776cec2a0af input=ff157eb918d0905b]*/
{
PyObject *dest = NULL;
char *mem;
Expand Down Expand Up @@ -2507,7 +2507,7 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len,

do {
PySSL_BEGIN_ALLOW_THREADS
retval = SSL_read_ex(self->ssl, mem, (size_t)len, &count);
retval = SSL_read_ex(self->ssl, mem, len, &count);
err = _PySSL_errno(retval == 0, self->ssl, retval);
PySSL_END_ALLOW_THREADS
self->err = err;
Expand Down
12 changes: 6 additions & 6 deletions Modules/clinic/_ssl.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ca3d2be

Please sign in to comment.