Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e00e2f00
Commit
e00e2f00
authored
Jun 30, 2010
by
Giampaolo Rodolà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue #6589: cleanup asyncore.socket_map if smtpd.SMTPServer constructor raises an exception
parent
10947a64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
Lib/smtpd.py
Lib/smtpd.py
+15
-9
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/smtpd.py
View file @
e00e2f00
...
...
@@ -274,15 +274,21 @@ class SMTPServer(asyncore.dispatcher):
self
.
_localaddr
=
localaddr
self
.
_remoteaddr
=
remoteaddr
asyncore
.
dispatcher
.
__init__
(
self
)
self
.
create_socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
# try to re-use a server port if possible
self
.
set_reuse_addr
()
self
.
bind
(
localaddr
)
self
.
listen
(
5
)
print
>>
DEBUGSTREAM
,
\
'%s started at %s
\
n
\
t
Local addr: %s
\
n
\
t
Remote addr:%s'
%
(
self
.
__class__
.
__name__
,
time
.
ctime
(
time
.
time
()),
localaddr
,
remoteaddr
)
try
:
self
.
create_socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
# try to re-use a server port if possible
self
.
set_reuse_addr
()
self
.
bind
(
localaddr
)
self
.
listen
(
5
)
except
:
# cleanup asyncore.socket_map before raising
self
.
close
()
raise
else
:
print
>>
DEBUGSTREAM
,
\
'%s started at %s
\
n
\
t
Local addr: %s
\
n
\
t
Remote addr:%s'
%
(
self
.
__class__
.
__name__
,
time
.
ctime
(
time
.
time
()),
localaddr
,
remoteaddr
)
def
handle_accept
(
self
):
conn
,
addr
=
self
.
accept
()
...
...
Misc/NEWS
View file @
e00e2f00
...
...
@@ -51,6 +51,9 @@ Build
Library
-------
- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
raises an exception.
- Issue #8959: fix regression caused by using unmodified libffi
library on Windows. ctypes does now again check the stack before
and after calling foreign functions.
...
...
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