Changeset fc8eefcd in mod_gnutls
- Timestamp:
- Dec 2, 2019, 2:09:59 PM (3 years ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- d9b0936
- Parents:
- 03426e0
- git-author:
- Fiona Klute <fiona.klute@…> (12/02/19 14:00:48)
- git-committer:
- Fiona Klute <fiona.klute@…> (12/02/19 14:09:59)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/https-test-client.py
r03426e0 rfc8eefcd 67 67 # Critical: "event" is a bitwise OR of the POLL* constants 68 68 for x, event in poller.poll(): 69 print(f'fd {x}: {event}')70 69 if event & select.POLLIN or event & select.POLLPRI: 71 70 data = in_stream.read() 72 print(f'read {len(data)} bytes')73 71 if cert_log in data: 74 72 data = data.replace(cert_log, b'') 75 print('skip')76 73 out_stream.send(data) 77 74 if event & select.POLLHUP or event & select.POLLRDHUP: … … 79 76 # might be in the list returned by poll() first. 80 77 run_loop = False 81 print('received HUP')82 sys.stdout.flush()83 84 print('filter process cleanin up')85 sys.stdout.flush()86 78 87 79 in_stream.close() … … 102 94 s_remote.close() 103 95 self.sock = s_local 104 print(f'socket created {self.sock}')105 sys.stdout.flush()106 96 107 97 def close(self): 108 traceback.print_stack() 109 # Wait for the process to stop, send SIGKILL if necessary 110 self._sproc.terminate() 111 self.returncode = self._sproc.wait(self.timeout) 112 if self.returncode == None: 113 self._sproc.kill() 98 # close socket to subprocess for writing 99 if self.sock: 100 self.sock.shutdown(socket.SHUT_WR) 101 102 # Wait for the process to stop, send SIGTERM/SIGKILL if 103 # necessary 104 try: 114 105 self.returncode = self._sproc.wait(self.timeout) 115 116 # filter process receives HUP on socket when the subprocess 106 except subprocess.TimeoutExpired: 107 try: 108 self._sproc.terminate() 109 self.returncode = self._sproc.wait(self.timeout) 110 except subprocess.TimeoutExpired: 111 self._sproc.kill() 112 self.returncode = self._sproc.wait(self.timeout) 113 114 # filter process receives HUP on pipe when the subprocess 117 115 # terminates 118 116 self._fproc.join() 119 117 120 print(f'socket closing {self.sock}') 118 # close the connection in the super class, which also calls 119 # self.sock.close() 121 120 super().close() 122 121
Note: See TracChangeset
for help on using the changeset viewer.