mirror of
https://github.com/python/cpython.git
synced 2025-12-09 10:37:17 +00:00
Fix conversion from Py_ssize_t to int.
This commit is contained in:
parent
84eadd8651
commit
b988ee0632
1 changed files with 4 additions and 2 deletions
|
|
@ -99,13 +99,15 @@ multiprocessing_send(PyObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
Py_buffer buf;
|
Py_buffer buf;
|
||||||
int ret;
|
int ret, length;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, F_HANDLE "y*:send" , &handle, &buf))
|
if (!PyArg_ParseTuple(args, F_HANDLE "y*:send" , &handle, &buf))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
length = (int)Py_MIN(buf.len, INT_MAX);
|
||||||
|
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
ret = send((SOCKET) handle, buf.buf, buf.len, 0);
|
ret = send((SOCKET) handle, buf.buf, length, 0);
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
|
|
||||||
PyBuffer_Release(&buf);
|
PyBuffer_Release(&buf);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue