Changeset db82911 in mod_gnutls for test/https-test-client.py
- Timestamp:
- Dec 2, 2019, 2:44:54 PM (17 months ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- 0a16644
- Parents:
- 4dfbedd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/https-test-client.py
r4dfbedd rdb82911 26 26 class HTTPSubprocessConnection(HTTPConnection): 27 27 def __init__(self, command, host, port=None, 28 output_filter=None, 28 29 timeout=socket._GLOBAL_DEFAULT_TIMEOUT, 29 30 blocksize=8192): … … 41 42 # (see exception doc) 42 43 self.set_tunnel = None 44 # This method will be run in a separate process and filter the 45 # stdout of self._sproc. Its arguments are self._sproc.stdout 46 # and the socket back to the HTTP connection (write-only). 47 self._output_filter = output_filter 48 # output filter process 43 49 self._fproc = None 44 50 … … 49 55 50 56 # TODO: Maybe capture stderr? 51 self._sproc = subprocess.Popen(self.command, stdout=subprocess.PIPE, 52 stdin=s_remote, close_fds=True, 53 bufsize=0) 54 self._fproc = Process(target=filter_cert_log, 55 args=(self._sproc.stdout, s_remote)) 56 self._fproc.start() 57 if self._output_filter: 58 self._sproc = subprocess.Popen(self.command, stdout=subprocess.PIPE, 59 stdin=s_remote, close_fds=True, 60 bufsize=0) 61 self._fproc = Process(target=self._output_filter, 62 args=(self._sproc.stdout, s_remote)) 63 self._fproc.start() 64 else: 65 self._sproc = subprocess.Popen(self.command, stdout=s_remote, 66 stdin=s_remote, close_fds=True, 67 bufsize=0) 57 68 s_remote.close() 58 69 self.sock = s_local … … 77 88 # filter process receives HUP on pipe when the subprocess 78 89 # terminates 79 self._fproc.join() 90 if self._fproc: 91 self._fproc.join() 80 92 81 93 # close the connection in the super class, which also calls … … 292 304 293 305 conn = HTTPSubprocessConnection(command, args.host, port=args.port, 306 output_filter=filter_cert_log, 294 307 timeout=6.0) 295 308
Note: See TracChangeset
for help on using the changeset viewer.