/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2012-05-06 17:23:08 UTC
  • Revision ID: teddy@recompile.se-20120506172308-xw7368koksmjmnv3
* mandos (Client.start_checker): Reworded comment.
 (MandosServer.handle_ipc): Removed dead code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
657
657
        If a checker already exists, leave it running and do
658
658
        nothing."""
659
659
        # The reason for not killing a running checker is that if we
660
 
        # did that, then if a checker (for some reason) started
661
 
        # running slowly and taking more than 'interval' time, the
662
 
        # client would inevitably timeout, since no checker would get
663
 
        # a chance to run to completion.  If we instead leave running
 
660
        # did that, and if a checker (for some reason) started running
 
661
        # slowly and taking more than 'interval' time, then the client
 
662
        # would inevitably timeout, since no checker would get a
 
663
        # chance to run to completion.  If we instead leave running
664
664
        # checkers alone, the checker would have to take more time
665
665
        # than 'timeout' for the client to be disabled, which is as it
666
666
        # should be.
1993
1993
    
1994
1994
    def handle_ipc(self, source, condition, parent_pipe=None,
1995
1995
                   proc = None, client_object=None):
1996
 
        condition_names = {
1997
 
            gobject.IO_IN: "IN",   # There is data to read.
1998
 
            gobject.IO_OUT: "OUT", # Data can be written (without
1999
 
                                    # blocking).
2000
 
            gobject.IO_PRI: "PRI", # There is urgent data to read.
2001
 
            gobject.IO_ERR: "ERR", # Error condition.
2002
 
            gobject.IO_HUP: "HUP"  # Hung up (the connection has been
2003
 
                                    # broken, usually for pipes and
2004
 
                                    # sockets).
2005
 
            }
2006
 
        conditions_string = ' | '.join(name
2007
 
                                       for cond, name in
2008
 
                                       condition_names.iteritems()
2009
 
                                       if cond & condition)
2010
1996
        # error, or the other end of multiprocessing.Pipe has closed
2011
 
        if condition & (gobject.IO_ERR | condition & gobject.IO_HUP):
 
1997
        if condition & (gobject.IO_ERR | gobject.IO_HUP):
2012
1998
            # Wait for other process to exit
2013
1999
            proc.join()
2014
2000
            return False