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
a57ec93b
Kaydet (Commit)
a57ec93b
authored
Agu 03, 2004
tarafından
Mark Hammond
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix [ 1001018 ]: Windows: setdefaulttimeout causes unnecessary timeouts on
connect error
üst
5ad28e14
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
socketmodule.c
Modules/socketmodule.c
+24
-3
No files found.
Modules/socketmodule.c
Dosyayı görüntüle @
a57ec93b
...
@@ -1694,17 +1694,38 @@ internal_connect(PySocketSockObject *s, struct sockaddr *addr, int addrlen,
...
@@ -1694,17 +1694,38 @@ internal_connect(PySocketSockObject *s, struct sockaddr *addr, int addrlen,
if
(
res
<
0
&&
WSAGetLastError
()
==
WSAEWOULDBLOCK
)
{
if
(
res
<
0
&&
WSAGetLastError
()
==
WSAEWOULDBLOCK
)
{
/* This is a mess. Best solution: trust select */
/* This is a mess. Best solution: trust select */
fd_set
fds
;
fd_set
fds
;
fd_set
fds_exc
;
struct
timeval
tv
;
struct
timeval
tv
;
tv
.
tv_sec
=
(
int
)
s
->
sock_timeout
;
tv
.
tv_sec
=
(
int
)
s
->
sock_timeout
;
tv
.
tv_usec
=
(
int
)((
s
->
sock_timeout
-
tv
.
tv_sec
)
*
1e6
);
tv
.
tv_usec
=
(
int
)((
s
->
sock_timeout
-
tv
.
tv_sec
)
*
1e6
);
FD_ZERO
(
&
fds
);
FD_ZERO
(
&
fds
);
FD_SET
(
s
->
sock_fd
,
&
fds
);
FD_SET
(
s
->
sock_fd
,
&
fds
);
res
=
select
(
s
->
sock_fd
+
1
,
NULL
,
&
fds
,
NULL
,
&
tv
);
FD_ZERO
(
&
fds_exc
);
FD_SET
(
s
->
sock_fd
,
&
fds_exc
);
res
=
select
(
s
->
sock_fd
+
1
,
NULL
,
&
fds
,
&
fds_exc
,
&
tv
);
if
(
res
==
0
)
{
if
(
res
==
0
)
{
res
=
WSAEWOULDBLOCK
;
res
=
WSAEWOULDBLOCK
;
timeout
=
1
;
timeout
=
1
;
}
else
if
(
res
>
0
)
}
else
if
(
res
>
0
)
{
res
=
0
;
if
(
FD_ISSET
(
s
->
sock_fd
,
&
fds
))
/* The socket is in the writeable set - this
means connected */
res
=
0
;
else
{
/* As per MS docs, we need to call getsockopt()
to get the underlying error */
int
res_size
=
sizeof
res
;
/* It must be in the exception set */
assert
(
FD_ISSET
(
s
->
sock_fd
,
&
fds_exc
));
if
(
0
==
getsockopt
(
s
->
sock_fd
,
SOL_SOCKET
,
SO_ERROR
,
(
char
*
)
&
res
,
&
res_size
))
/* getsockopt also clears WSAGetLastError,
so reset it back. */
WSASetLastError
(
res
);
else
res
=
WSAGetLastError
();
}
}
/* else if (res < 0) an error occurred */
/* else if (res < 0) an error occurred */
}
}
}
}
...
...
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