mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
test1450: fix up DICT server in torture mode
As per https://github.com/curl/curl/pull/1615, the DICT server is a little spammy in torture mode due to the sockets being torn down unexpectedly. Fix this by adding some error handling to the handling function. Closes #1629
This commit is contained in:
parent
9b387034ab
commit
0362c77841
@ -52,7 +52,7 @@ class DictHandler(socketserver.BaseRequestHandler):
|
|||||||
"""
|
"""
|
||||||
Simple function which responds to all queries with a 552.
|
Simple function which responds to all queries with a 552.
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
# First, send a response to allow the server to continue.
|
# First, send a response to allow the server to continue.
|
||||||
rsp = "220 dictserver <xnooptions> <msgid@msgid>\n"
|
rsp = "220 dictserver <xnooptions> <msgid@msgid>\n"
|
||||||
self.request.sendall(rsp.encode("utf-8"))
|
self.request.sendall(rsp.encode("utf-8"))
|
||||||
@ -74,6 +74,9 @@ class DictHandler(socketserver.BaseRequestHandler):
|
|||||||
log.debug("[DICT] Responding with %r", response)
|
log.debug("[DICT] Responding with %r", response)
|
||||||
self.request.sendall(response.encode("utf-8"))
|
self.request.sendall(response.encode("utf-8"))
|
||||||
|
|
||||||
|
except IOError:
|
||||||
|
log.exception("[DICT] IOError hit during request")
|
||||||
|
|
||||||
|
|
||||||
def get_options():
|
def get_options():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
Loading…
Reference in New Issue
Block a user