Show More
@@ -9,6 +9,7 b' import optparse' | |||||
9 | import smtpd |
|
9 | import smtpd | |
10 | import ssl |
|
10 | import ssl | |
11 | import sys |
|
11 | import sys | |
|
12 | import traceback | |||
12 |
|
13 | |||
13 | from mercurial import ( |
|
14 | from mercurial import ( | |
14 | server, |
|
15 | server, | |
@@ -27,6 +28,15 b' class dummysmtpserver(smtpd.SMTPServer):' | |||||
27 | def process_message(self, peer, mailfrom, rcpttos, data): |
|
28 | def process_message(self, peer, mailfrom, rcpttos, data): | |
28 | log('%s from=%s to=%s\n' % (peer[0], mailfrom, ', '.join(rcpttos))) |
|
29 | log('%s from=%s to=%s\n' % (peer[0], mailfrom, ', '.join(rcpttos))) | |
29 |
|
30 | |||
|
31 | def handle_error(self): | |||
|
32 | # On Windows, a bad SSL connection sometimes generates a WSAECONNRESET. | |||
|
33 | # The default handler will shutdown this server, and then both the | |||
|
34 | # current connection and subsequent ones fail on the client side with | |||
|
35 | # "No connection could be made because the target machine actively | |||
|
36 | # refused it". If we eat the error, then the client properly aborts in | |||
|
37 | # the expected way, and the server is available for subsequent requests. | |||
|
38 | traceback.print_exc() | |||
|
39 | ||||
30 | class dummysmtpsecureserver(dummysmtpserver): |
|
40 | class dummysmtpsecureserver(dummysmtpserver): | |
31 | def __init__(self, localaddr, certfile): |
|
41 | def __init__(self, localaddr, certfile): | |
32 | dummysmtpserver.__init__(self, localaddr) |
|
42 | dummysmtpserver.__init__(self, localaddr) |
General Comments 0
You need to be logged in to leave comments.
Login now