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
6252083f
Kaydet (Commit)
6252083f
authored
Agu 04, 2007
tarafından
Jeremy Hylton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Change read() on SSL socket to return bytes.
üst
97043c3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
_ssl.c
Modules/_ssl.c
+7
-4
No files found.
Modules/_ssl.c
Dosyayı görüntüle @
6252083f
...
...
@@ -496,7 +496,7 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"|i:read"
,
&
len
))
return
NULL
;
if
(
!
(
buf
=
Py
String
_FromStringAndSize
((
char
*
)
0
,
len
)))
if
(
!
(
buf
=
Py
Bytes
_FromStringAndSize
((
char
*
)
0
,
len
)))
return
NULL
;
/* first check if there are bytes ready to be read */
...
...
@@ -518,7 +518,7 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
do
{
err
=
0
;
Py_BEGIN_ALLOW_THREADS
count
=
SSL_read
(
self
->
ssl
,
Py
String_AsString
(
buf
),
len
);
count
=
SSL_read
(
self
->
ssl
,
Py
Bytes_AS_STRING
(
buf
),
len
);
err
=
SSL_get_error
(
self
->
ssl
,
count
);
Py_END_ALLOW_THREADS
if
(
PyErr_CheckSignals
())
{
...
...
@@ -545,12 +545,15 @@ static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args)
return
PySSL_SetError
(
self
,
count
);
}
if
(
count
!=
len
)
_PyString_Resize
(
&
buf
,
count
);
if
(
PyBytes_Resize
(
buf
,
count
)
<
0
)
{
Py_DECREF
(
buf
);
return
NULL
;
}
return
buf
;
}
PyDoc_STRVAR
(
PySSL_SSLread_doc
,
"read([len]) ->
string
\n
\
"read([len]) ->
bytes
\n
\
\n
\
Read up to len bytes from the SSL socket."
);
...
...
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