webserver.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:reahl 作者: reahl 项目源码 文件源码
def finish_response(self):
        # If the browser closes the connection while we still want to sen stuff back,
        # we want to fail silently and give up. This often happens in tests where the
        # browser may want to request embedded links (like stylesheets) too, yet the
        # test has already clicked on the next link.
        if six.PY3:
            ssl_eof_error = ssl.SSLEOFError
            broken_pipe_error = BrokenPipeError
        else:
            ssl_eof_error = ssl.SSLError
            broken_pipe_error = socket.error

        try:
            ServerHandler.finish_response(self)
        except (ssl_eof_error,  broken_pipe_error):
            # Silently ignore it if it looks like the client browser closed the connection.
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号