[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 85/208: test1450: fix up DICT server in torture mod
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 85/208: test1450: fix up DICT server in torture mode |
Date: |
Wed, 09 Aug 2017 17:34:42 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.55.0
in repository gnurl.
commit 0362c778418a7c0594dae5537f91247ca1dae289
Author: Max Dymond <address@hidden>
AuthorDate: Fri Jun 30 12:45:17 2017 +0100
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
---
tests/dictserver.py | 39 +++++++++++++++++++++------------------
1 file changed, 21 insertions(+), 18 deletions(-)
diff --git a/tests/dictserver.py b/tests/dictserver.py
index 45cc15505..a41a8a0d6 100755
--- a/tests/dictserver.py
+++ b/tests/dictserver.py
@@ -52,34 +52,37 @@ 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> <address@hidden>\n"
+ self.request.sendall(rsp.encode("utf-8"))
- # First, send a response to allow the server to continue.
- rsp = "220 dictserver <xnooptions> <address@hidden>\n"
- self.request.sendall(rsp.encode("utf-8"))
+ # Receive the request.
+ data = self.request.recv(1024).strip()
+ log.debug("[DICT] Incoming data: %r", data)
- # Receive the request.
- data = self.request.recv(1024).strip()
- log.debug("[DICT] Incoming data: %r", data)
+ if VERIFIED_REQ in data:
+ log.debug("[DICT] Received verification request from test "
+ "framework")
+ response_data = VERIFIED_RSP.format(pid=os.getpid())
+ else:
+ log.debug("[DICT] Received normal request")
+ response_data = "No matches"
- if VERIFIED_REQ in data:
- log.debug("[DICT] Received verification request from test "
- "framework")
- response_data = VERIFIED_RSP.format(pid=os.getpid())
- else:
- log.debug("[DICT] Received normal request")
- response_data = "No matches"
+ # Send back a failure to find.
+ response = "552 {0}\n".format(response_data)
+ log.debug("[DICT] Responding with %r", response)
+ self.request.sendall(response.encode("utf-8"))
- # Send back a failure to find.
- response = "552 {0}\n".format(response_data)
- 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()
parser.add_argument("--port", action="store", default=9016,
- type=int, help="port to listen on")
+ type=int, help="port to listen on")
parser.add_argument("--verbose", action="store", type=int, default=0,
help="verbose output")
parser.add_argument("--pidfile", action="store",
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 171/208: curl_setup: Define CURL_NO_OLDIES for building libcurl, (continued)
- [GNUnet-SVN] [gnurl] 171/208: curl_setup: Define CURL_NO_OLDIES for building libcurl, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 192/208: RELEASE-NOTES: synced with 561e9217c, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 189/208: travis: explicitly specify dist, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 178/208: travis: build osx with libressl too, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 187/208: travis: add osx build with darwinssl, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 139/208: ISSUE_TEMPLATE: Add a comment not to file security issues on github, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 164/208: AppVeyor: now really use CURL_WERROR, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 79/208: progress: prevent resetting t_starttransfer, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 201/208: curl: detect and bail out early on parameter integer overflows, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 173/208: BUGS: clarify how to report security related bugs, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 85/208: test1450: fix up DICT server in torture mode,
gnunet <=
- [GNUnet-SVN] [gnurl] 166/208: cmake: support make uninstall, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 170/208: configure: fix the check for IdnToUnicode, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 60/208: CONTRIBUTE.md: mention the out-of-tree build test too, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 92/208: timeval.c: Use long long constant type for timeval assignment, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 107/208: inet_pton: fix include on windows to get prototype, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 102/208: smb: add support for CURLOPT_FILETIME, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 103/208: RELEASE-NOTES: synced with 596cfb6c0, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 71/208: tool_getparam: fix memory leak on test 1147 OOM (torture tests), gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 146/208: winbuild: re-enable warning C4127 for curl tool, gnunet, 2017/08/09
- [GNUnet-SVN] [gnurl] 175/208: curl_threads: fix MSVC compiler warning, gnunet, 2017/08/09