mirror of
https://github.com/python/cpython.git
synced 2025-10-27 16:57:08 +00:00
Merged revisions 82407 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r82407 | giampaolo.rodola | 2010-06-30 19:47:39 +0200 (mer, 30 giu 2010) | 9 lines
Merged revisions 82404 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r82404 | giampaolo.rodola | 2010-06-30 19:38:28 +0200 (mer, 30 giu 2010) | 1 line
fix issue #6589: cleanup asyncore.socket_map if smtpd.SMTPServer constructor raises an exception
........
................
This commit is contained in:
parent
bf9f79b185
commit
d68ed93824
2 changed files with 16 additions and 8 deletions
21
Lib/smtpd.py
21
Lib/smtpd.py
|
|
@ -274,14 +274,19 @@ class SMTPServer(asyncore.dispatcher):
|
||||||
self._localaddr = localaddr
|
self._localaddr = localaddr
|
||||||
self._remoteaddr = remoteaddr
|
self._remoteaddr = remoteaddr
|
||||||
asyncore.dispatcher.__init__(self)
|
asyncore.dispatcher.__init__(self)
|
||||||
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
try:
|
||||||
# try to re-use a server port if possible
|
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
self.set_reuse_addr()
|
# try to re-use a server port if possible
|
||||||
self.bind(localaddr)
|
self.set_reuse_addr()
|
||||||
self.listen(5)
|
self.bind(localaddr)
|
||||||
print('%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s' % (
|
self.listen(5)
|
||||||
self.__class__.__name__, time.ctime(time.time()),
|
except:
|
||||||
localaddr, remoteaddr), file=DEBUGSTREAM)
|
self.close()
|
||||||
|
raise
|
||||||
|
else:
|
||||||
|
print('%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s' % (
|
||||||
|
self.__class__.__name__, time.ctime(time.time()),
|
||||||
|
localaddr, remoteaddr), file=DEBUGSTREAM)
|
||||||
|
|
||||||
def handle_accept(self):
|
def handle_accept(self):
|
||||||
conn, addr = self.accept()
|
conn, addr = self.accept()
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,9 @@ C-API
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #6589: cleanup asyncore.socket_map in case smtpd.SMTPServer constructor
|
||||||
|
raises an exception.
|
||||||
|
|
||||||
- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag
|
- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag
|
||||||
on an OpenSSL structure.
|
on an OpenSSL structure.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue