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
977c424e
Kaydet (Commit)
977c424e
authored
Eki 13, 2014
tarafından
Charles-François Natali
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22435: Fix a file descriptor leak when SocketServer bind fails.
üst
c468abaf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
SocketServer.py
Lib/SocketServer.py
+6
-2
test_socketserver.py
Lib/test/test_socketserver.py
+10
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/SocketServer.py
Dosyayı görüntüle @
977c424e
...
...
@@ -416,8 +416,12 @@ class TCPServer(BaseServer):
self
.
socket
=
socket
.
socket
(
self
.
address_family
,
self
.
socket_type
)
if
bind_and_activate
:
self
.
server_bind
()
self
.
server_activate
()
try
:
self
.
server_bind
()
self
.
server_activate
()
except
:
self
.
server_close
()
raise
def
server_bind
(
self
):
"""Called by constructor to bind the socket.
...
...
Lib/test/test_socketserver.py
Dosyayı görüntüle @
977c424e
...
...
@@ -314,6 +314,16 @@ class SocketServerTest(unittest.TestCase):
for
t
,
s
in
threads
:
t
.
join
()
def
test_tcpserver_bind_leak
(
self
):
# Issue #22435: the server socket wouldn't be closed if bind()/listen()
# failed.
# Create many servers for which bind() will fail, to see if this result
# in FD exhaustion.
for
i
in
range
(
1024
):
with
self
.
assertRaises
(
OverflowError
):
SocketServer
.
TCPServer
((
HOST
,
-
1
),
SocketServer
.
StreamRequestHandler
)
def
test_main
():
if
imp
.
lock_held
():
...
...
Misc/NEWS
Dosyayı görüntüle @
977c424e
...
...
@@ -19,6 +19,8 @@ Core and Builtins
Library
-------
- Issue #22435: Fix a file descriptor leak when SocketServer bind fails.
- Issue #21580: Now Tkinter correctly handles binary "data" and "maskdata"
configure options of tkinter.PhotoImage.
...
...
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