def __init__(self,*args,**kwargs): # respect the rents SCGIConnection.__init__(self,*args,**kwargs) # where will we get our data ? self.collector = None # update the environ to include our helper methods self.environ.update({ 'create_udp_collector':self.server.manager.create_collector, 'feed_from_udp':self.feed_from_udp }) log.info('HTTPHandler: Initializing')
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
def handle_close(self): # call our rent which will close the connection SCGIConnection.handle_close(self) log.info("HTTPHandler: Closing") self.clean_up()