Exemplo n.º 1
0
    def writable(self):
        # if we are on a collector but don't have anything to go
        # out than return false. This way the SCGIConnector won't
        # think we are done and close the socket

        #return SCGIConnection.writable(self)

        writable = SCGIConnection.writable(self)
        log.debug('SCGIconn writable: %s' % writable)

        # we've got some data, we're good to go
        if writable and self.outbuff:
            log.debug('outbuff, writable')
            return True

        # we haven't sent the headers yet, but we can
        if writable and self.outheaders != True:
            log.debug('outheaders, writable')
            return True

        if writable and self.wsgihandler and self.outheaders != True:
            log.debug('wsgihandler, writable')
            return True

        return False