session.py 文件源码

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

项目:mixmatch 作者: openstack 项目源码 文件源码
def chunked_reader():
    try:
        # If we're running under uWSGI, use the uwsgi.chunked_read method
        # to read chunked input.
        import uwsgi  # noqa

        while True:
            chunk = uwsgi.chunked_read()
            if len(chunk) > 0:
                yield chunk
            else:
                return
    except ImportError:
        # Otherwise try to read the wsgi input. This works in embedded Apache.
        stream = flask.request.environ["wsgi.input"]
        try:
            while True:
                yield stream.next()
        except Exception:
            return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号