Changeset eed0c4b in mod_gnutls


Ignore:
Timestamp:
Dec 4, 2019, 3:01:11 AM (10 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
master, proxy-ticket
Children:
5c7e570
Parents:
0a16644
Message:

HTTPSubprocessConnection: Ensure subprocess exists before closing

This avoids an exception if close() is called before connect() for
some reason. If there's no subprocess there's no need to stop one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/https-test-client.py

    r0a16644 reed0c4b  
    7676        # Wait for the process to stop, send SIGTERM/SIGKILL if
    7777        # necessary
    78         try:
    79             self.returncode = self._sproc.wait(self.timeout)
    80         except subprocess.TimeoutExpired:
     78        if self._sproc:
    8179            try:
    82                 self._sproc.terminate()
    8380                self.returncode = self._sproc.wait(self.timeout)
    8481            except subprocess.TimeoutExpired:
    85                 self._sproc.kill()
    86                 self.returncode = self._sproc.wait(self.timeout)
     82                try:
     83                    self._sproc.terminate()
     84                    self.returncode = self._sproc.wait(self.timeout)
     85                except subprocess.TimeoutExpired:
     86                    self._sproc.kill()
     87                    self.returncode = self._sproc.wait(self.timeout)
    8788
    8889        # filter process receives HUP on pipe when the subprocess
Note: See TracChangeset for help on using the changeset viewer.