Commit 0362c778 authored by Max Dymond's avatar Max Dymond Committed by Daniel Stenberg
Browse files

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
parent 9b387034
Loading
Loading
Loading
Loading
+21 −18
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ class DictHandler(socketserver.BaseRequestHandler):
        """
        Simple function which responds to all queries with a 552.
        """

        try:
            # First, send a response to allow the server to continue.
            rsp = "220 dictserver <xnooptions> <msgid@msgid>\n"
            self.request.sendall(rsp.encode("utf-8"))
@@ -74,6 +74,9 @@ class DictHandler(socketserver.BaseRequestHandler):
            log.debug("[DICT] Responding with %r", response)
            self.request.sendall(response.encode("utf-8"))

        except IOError:
            log.exception("[DICT] IOError hit during request")


def get_options():
    parser = argparse.ArgumentParser()