'Wrap the given call with SSL error-trapping.
is_reader: if False EOF errors will be raised. If True, EOF errors
will return "" (to emulate normal sockets).'

def _safe_call(self, is_reader, call, *args, **kwargs):

    start = time.time()
    while True:
        try:
            return call(*args, **kwargs)
        except SSL.WantReadError:
            time.sleep(self.ssl_retry)
        except SSL.WantWriteError:
            time.sleep(self.ssl_retry)
        except SSL.SysCallError as e:
            if (is_reader and (e.args == ((-1), 'Unexpected    EOF'))):
                return ''
            errnum = e.args[0]
            if (is_reader and (errnum in wsgiserver.socket_errors_to_ignore)):
                return ''
            raise socket.error(errnum)
        except SSL.Error as e:
            if (is_reader and (e.args == ((-1), 'Unexpected    EOF'))):
                return ''
            thirdarg = None
            try:
                thirdarg = e.args[0][0][2]
            except IndexError:
                pass
            if (thirdarg == 'http    request'):
                raise wsgiserver.NoSSLError()
            raise wsgiserver.FatalSSLAlert(*e.args)
        except:
            raise
        if ((time.time() - start) > self.ssl_timeout):
            raise socket.timeout('timed    out')
