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
d3afb62b
Kaydet (Commit)
d3afb62b
authored
Tem 22, 2016
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge 3.5 (INVALID_SOCKET)
üst
5e1989ce
524714ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
_ssl.c
Modules/_ssl.c
+6
-2
socketmodule.c
Modules/socketmodule.c
+6
-6
No files found.
Modules/_ssl.c
Dosyayı görüntüle @
d3afb62b
...
...
@@ -113,6 +113,10 @@ struct py_ssl_library_code {
# define HAVE_ALPN
#endif
#ifndef INVALID_SOCKET
/* MS defines this */
#define INVALID_SOCKET (-1)
#endif
enum
py_ssl_error
{
/* these mirror ssl.h */
PY_SSL_ERROR_NONE
,
...
...
@@ -1699,7 +1703,7 @@ PySSL_select(PySocketSockObject *s, int writing, _PyTime_t timeout)
}
/* Guard against closed socket */
if
(
s
->
sock_fd
<
0
)
if
(
s
->
sock_fd
==
INVALID_SOCKET
)
return
SOCKET_HAS_BEEN_CLOSED
;
/* Prefer poll, if available, since you can poll() any fd
...
...
@@ -2023,7 +2027,7 @@ _ssl__SSLSocket_shutdown_impl(PySSLSocket *self)
if
(
sock
!=
NULL
)
{
/* Guard against closed socket */
if
((((
PyObject
*
)
sock
)
==
Py_None
)
||
(
sock
->
sock_fd
<
0
))
{
if
((((
PyObject
*
)
sock
)
==
Py_None
)
||
(
sock
->
sock_fd
==
INVALID_SOCKET
))
{
_setSSLError
(
"Underlying socket connection gone"
,
PY_SSL_ERROR_NO_SOCKET
,
__FILE__
,
__LINE__
);
return
NULL
;
...
...
Modules/socketmodule.c
Dosyayı görüntüle @
d3afb62b
...
...
@@ -2579,8 +2579,8 @@ sock_close(PySocketSockObject *s)
int
res
;
fd
=
s
->
sock_fd
;
if
(
fd
!=
-
1
)
{
s
->
sock_fd
=
-
1
;
if
(
fd
!=
INVALID_SOCKET
)
{
s
->
sock_fd
=
INVALID_SOCKET
;
/* We do not want to retry upon EINTR: see
http://lwn.net/Articles/576478/ and
...
...
@@ -2606,7 +2606,7 @@ static PyObject *
sock_detach
(
PySocketSockObject
*
s
)
{
SOCKET_T
fd
=
s
->
sock_fd
;
s
->
sock_fd
=
-
1
;
s
->
sock_fd
=
INVALID_SOCKET
;
return
PyLong_FromSocket_t
(
fd
);
}
...
...
@@ -4202,7 +4202,7 @@ sock_finalize(PySocketSockObject *s)
/* Save the current exception, if any. */
PyErr_Fetch
(
&
error_type
,
&
error_value
,
&
error_traceback
);
if
(
s
->
sock_fd
!=
-
1
)
{
if
(
s
->
sock_fd
!=
INVALID_SOCKET
)
{
if
(
PyErr_ResourceWarning
((
PyObject
*
)
s
,
1
,
"unclosed %R"
,
s
))
{
/* Spurious errors can appear at shutdown */
if
(
PyErr_ExceptionMatches
(
PyExc_Warning
))
{
...
...
@@ -4215,7 +4215,7 @@ sock_finalize(PySocketSockObject *s)
socket.getsockname(). If the socket is closed before, socket
methods fails with the EBADF error. */
fd
=
s
->
sock_fd
;
s
->
sock_fd
=
-
1
;
s
->
sock_fd
=
INVALID_SOCKET
;
/* We do not want to retry upon EINTR: see sock_close() */
Py_BEGIN_ALLOW_THREADS
...
...
@@ -4275,7 +4275,7 @@ sock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
new
=
type
->
tp_alloc
(
type
,
0
);
if
(
new
!=
NULL
)
{
((
PySocketSockObject
*
)
new
)
->
sock_fd
=
-
1
;
((
PySocketSockObject
*
)
new
)
->
sock_fd
=
INVALID_SOCKET
;
((
PySocketSockObject
*
)
new
)
->
sock_timeout
=
_PyTime_FromSeconds
(
-
1
);
((
PySocketSockObject
*
)
new
)
->
errorhandler
=
&
set_error
;
}
...
...
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