NavigaTor.py 文件源码

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

项目:navigator 作者: naviga-tor 项目源码 文件源码
def _attach_stream(self, event):
        """ Attach stream to circuit. """
        try:
            self._controller.attach_stream(event.id, self._cid)
        except (OperationFailed, InvalidRequest), error:
            error = str(error)
            # If circuit is already closed, close stream too.
            if error in (('Unknown circuit "%s"' % self._cid),
                         "Can't attach stream to non-open origin circuit"):
                self._controller.close_stream(event.id)
            # Ignore the rare cases (~5*10^-7) where a stream has already been
            # closed almost directly after its NEW-event has been received.
            elif error == 'Unknown stream "%s"' % event.id:
                sys.stderr.write('Stream %s has already been ' +
                                 'closed.\n' % event.id)
            else:
                raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号