Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
926f58df
Kaydet (Commit)
926f58df
authored
Haz 11, 2012
tarafından
Richard Oudkerk
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #10133: Make multiprocessing deallocate buffer if socket read fails.
Patch by Hallvard B Furuseth.
üst
0c2c692b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
NEWS
Misc/NEWS
+3
-0
socket_connection.c
Modules/_multiprocessing/socket_connection.c
+16
-13
No files found.
Misc/NEWS
Dosyayı görüntüle @
926f58df
...
...
@@ -67,6 +67,9 @@ Core and Builtins
Library
-------
-
Issue
#
10133
:
Make
multiprocessing
deallocate
buffer
if
socket
read
fails
.
Patch
by
Hallvard
B
Furuseth
.
-
Issue
#
13854
:
Make
multiprocessing
properly
handle
non
-
integer
non
-
string
argument
to
SystemExit
.
...
...
Modules/_multiprocessing/socket_connection.c
Dosyayı görüntüle @
926f58df
...
...
@@ -117,7 +117,7 @@ static Py_ssize_t
conn_recv_string
(
ConnectionObject
*
conn
,
char
*
buffer
,
size_t
buflength
,
char
**
newbuffer
,
size_t
maxlength
)
{
in
t
res
;
Py_ssize_
t
res
;
UINT32
ulength
;
*
newbuffer
=
NULL
;
...
...
@@ -132,20 +132,23 @@ conn_recv_string(ConnectionObject *conn, char *buffer,
if
(
ulength
>
maxlength
)
return
MP_BAD_MESSAGE_LENGTH
;
if
(
ulength
<=
buflength
)
{
Py_BEGIN_ALLOW_THREADS
res
=
_conn_recvall
(
conn
->
handle
,
buffer
,
(
size_t
)
ulength
);
Py_END_ALLOW_THREADS
return
res
<
0
?
res
:
ulength
;
}
else
{
*
newbuffer
=
PyMem_Malloc
((
size_t
)
ulength
);
if
(
*
newbuffer
==
NULL
)
if
(
ulength
>
buflength
)
{
*
newbuffer
=
buffer
=
PyMem_Malloc
((
size_t
)
ulength
);
if
(
buffer
==
NULL
)
return
MP_MEMORY_ERROR
;
Py_BEGIN_ALLOW_THREADS
res
=
_conn_recvall
(
conn
->
handle
,
*
newbuffer
,
(
size_t
)
ulength
);
Py_END_ALLOW_THREADS
return
res
<
0
?
(
Py_ssize_t
)
res
:
(
Py_ssize_t
)
ulength
;
}
Py_BEGIN_ALLOW_THREADS
res
=
_conn_recvall
(
conn
->
handle
,
buffer
,
(
size_t
)
ulength
);
Py_END_ALLOW_THREADS
if
(
res
>=
0
)
{
res
=
(
Py_ssize_t
)
ulength
;
}
else
if
(
*
newbuffer
!=
NULL
)
{
PyMem_Free
(
*
newbuffer
);
*
newbuffer
=
NULL
;
}
return
res
;
}
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment