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
d524b705
Kaydet (Commit)
d524b705
authored
Mar 28, 2016
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #23804: Fix SSL recv/read(0) to not return 1024 bytes
üst
b8089b4d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
ssl.py
Lib/ssl.py
+2
-2
test_ssl.py
Lib/test/test_ssl.py
+8
-1
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/ssl.py
Dosyayı görüntüle @
d524b705
...
...
@@ -625,7 +625,7 @@ class SSLSocket(socket):
# EAGAIN.
self
.
getpeername
()
def
read
(
self
,
len
=
0
,
buffer
=
None
):
def
read
(
self
,
len
=
1024
,
buffer
=
None
):
"""Read up to LEN bytes and return them.
Return zero-length string on EOF."""
...
...
@@ -636,7 +636,7 @@ class SSLSocket(socket):
if
buffer
is
not
None
:
v
=
self
.
_sslobj
.
read
(
len
,
buffer
)
else
:
v
=
self
.
_sslobj
.
read
(
len
or
1024
)
v
=
self
.
_sslobj
.
read
(
len
)
return
v
except
SSLError
as
x
:
if
x
.
args
[
0
]
==
SSL_ERROR_EOF
and
self
.
suppress_ragged_eofs
:
...
...
Lib/test/test_ssl.py
Dosyayı görüntüle @
d524b705
...
...
@@ -2622,13 +2622,20 @@ else:
# consume data
s
.
read
()
# read(-1, buffer) is supported, even though read(-1) is not
data
=
b
"data"
# read(-1, buffer) is supported, even though read(-1) is not
s
.
send
(
data
)
buffer
=
bytearray
(
len
(
data
))
self
.
assertEqual
(
s
.
read
(
-
1
,
buffer
),
len
(
data
))
self
.
assertEqual
(
buffer
,
data
)
# recv/read(0) should return no data
s
.
send
(
data
)
self
.
assertEqual
(
s
.
recv
(
0
),
b
""
)
self
.
assertEqual
(
s
.
read
(
0
),
b
""
)
self
.
assertEqual
(
s
.
read
(),
data
)
s
.
write
(
b
"over
\n
"
)
self
.
assertRaises
(
ValueError
,
s
.
recv
,
-
1
)
...
...
Misc/NEWS
Dosyayı görüntüle @
d524b705
...
...
@@ -64,6 +64,9 @@ Library
-
Issue
#
26644
:
Raise
ValueError
rather
than
SystemError
when
a
negative
length
is
passed
to
SSLSocket
.
recv
()
or
read
().
-
Issue
#
23804
:
Fix
SSL
recv
(
0
)
and
read
(
0
)
methods
to
return
zero
bytes
instead
of
up
to
1024.
-
Issue
#
24266
:
Ctrl
+
C
during
Readline
history
search
now
cancels
the
search
mode
when
compiled
with
Readline
7.
...
...
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