/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: 2019-08-24 14:52:59 UTC
  • Revision ID: teddy@recompile.se-20190824145259-ifatm1r12kyp4z25
Server: Use new GLib.io_add_watch() call signature

* INSTALL: Increase version requirement of PyGObject to 3.8.
* mandos: When calling GLib.io_add_watch(), always pass priority as
          the second argument, which is supported by PyGObject 3.8 or
          later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1150
1150
                kwargs=popen_args)
1151
1151
            self.checker.start()
1152
1152
            self.checker_callback_tag = GLib.io_add_watch(
1153
 
                pipe[0].fileno(), GLib.IO_IN,
 
1153
                pipe[0].fileno(), GLib.PRIORITY_DEFAULT, GLib.IO_IN,
1154
1154
                self.checker_callback, pipe[0], command)
1155
1155
        # Re-run this periodically if run by GLib.timeout_add
1156
1156
        return True
2680
2680
    def add_pipe(self, parent_pipe, proc):
2681
2681
        # Call "handle_ipc" for both data and EOF events
2682
2682
        GLib.io_add_watch(
2683
 
            parent_pipe.fileno(),
 
2683
            parent_pipe.fileno(), GLib.PRIORITY_DEFAULT,
2684
2684
            GLib.IO_IN | GLib.IO_HUP,
2685
2685
            functools.partial(self.handle_ipc,
2686
2686
                              parent_pipe=parent_pipe,
2725
2725
                return False
2726
2726
 
2727
2727
            GLib.io_add_watch(
2728
 
                parent_pipe.fileno(),
 
2728
                parent_pipe.fileno(), GLib.PRIORITY_DEFAULT,
2729
2729
                GLib.IO_IN | GLib.IO_HUP,
2730
2730
                functools.partial(self.handle_ipc,
2731
2731
                                  parent_pipe=parent_pipe,
3602
3602
                sys.exit(1)
3603
3603
            # End of Avahi example code
3604
3604
 
3605
 
        GLib.io_add_watch(tcp_server.fileno(), GLib.IO_IN,
 
3605
        GLib.io_add_watch(tcp_server.fileno(), GLib.PRIORITY_DEFAULT,
 
3606
                          GLib.IO_IN,
3606
3607
                          lambda *args, **kwargs:
3607
3608
                          (tcp_server.handle_request
3608
3609
                           (*args[2:], **kwargs) or True))