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
0b87831d
Kaydet (Commit)
0b87831d
authored
Tem 31, 2014
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplify code in multiprocessing.Connection.send_bytes().
Followup to issue #20540; patch by Serhiy.
üst
cac9e719
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
connection.py
Lib/multiprocessing/connection.py
+6
-9
No files found.
Lib/multiprocessing/connection.py
Dosyayı görüntüle @
0b87831d
...
@@ -400,17 +400,14 @@ class Connection(_ConnectionBase):
...
@@ -400,17 +400,14 @@ class Connection(_ConnectionBase):
if
n
>
16384
:
if
n
>
16384
:
# The payload is large so Nagle's algorithm won't be triggered
# The payload is large so Nagle's algorithm won't be triggered
# and we'd better avoid the cost of concatenation.
# and we'd better avoid the cost of concatenation.
chunks
=
[
header
,
buf
]
self
.
_send
(
header
)
elif
n
>
0
:
self
.
_send
(
buf
)
else
:
# Issue # 20540: concatenate before sending, to avoid delays due
# Issue # 20540: concatenate before sending, to avoid delays due
# to Nagle's algorithm on a TCP socket.
# to Nagle's algorithm on a TCP socket.
chunks
=
[
header
+
buf
]
# Also note we want to avoid sending a 0-length buffer separately,
else
:
# to avoid "broken pipe" errors if the other end closed the pipe.
# This code path is necessary to avoid "broken pipe" errors
self
.
_send
(
header
+
buf
)
# when sending a 0-length buffer if the other end closed the pipe.
chunks
=
[
header
]
for
chunk
in
chunks
:
self
.
_send
(
chunk
)
def
_recv_bytes
(
self
,
maxsize
=
None
):
def
_recv_bytes
(
self
,
maxsize
=
None
):
buf
=
self
.
_recv
(
4
)
buf
=
self
.
_recv
(
4
)
...
...
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