Esempio n. 1
0
    def tcp_readable(self):
        if self.__header_ok:
            self.__wsgi.input(self.reader.read())
            return
        ok, cgi_env, body_data = self.__parse_scgi_header()
        if not ok: return
        self.__header_ok = True

        del cgi_env["SCGI"]

        self.__wsgi = wsgi.wsgi(self.__application, cgi_env, self.__resp_header, self.__resp_body_data,
                                self.__finish_request)
        self.__wsgi.input(body_data)
        self.__mtime = time.time()
        self.__wsgi.handle()
        self.add_to_loop_task(self.fileno)
Esempio n. 2
0
    def tcp_readable(self):
        if self.__header_ok:
            self.__wsgi.input(self.reader.read())
            return
        ok, cgi_env, body_data = self.__parse_scgi_header()
        if not ok: return
        self.__header_ok = True

        del cgi_env["SCGI"]

        self.__wsgi = wsgi.wsgi(self.__application, cgi_env, self.__resp_header, self.__resp_body_data,
                                self.__finish_request, debug=self.__configs.get("debug", False))
        self.__wsgi.input(body_data)
        self.__mtime = time.time()
        self.__wsgi.handle()
        self.add_to_loop_task(self.fileno)