commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 56/98: auth: improve the auth_demuxer function


From: Samuel Thibault
Subject: [hurd] 56/98: auth: improve the auth_demuxer function
Date: Tue, 14 Jan 2014 02:00:02 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 03e6f1fa6846dd860d0cd7babee62b8767cade30
Author: Justus Winter <address@hidden>
Date:   Wed Dec 4 10:13:56 2013 +0100

    auth: improve the auth_demuxer function
    
    Handle multiple request types as recommended by the Mach Server
    Writer's Guide section 4, subsection "Handling Multiple Request
    Types".  This avoids initializing the reply message in every X_server
    function.  The reply message has already been properly initialized in
    libports, so there is no need to call mig_reply_setup.
    
    * auth/auth.c (auth_demuxer): Improve the demuxer function.
---
 auth/auth.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/auth/auth.c b/auth/auth.c
index 91a21e4..a395e79 100644
--- a/auth/auth.c
+++ b/auth/auth.c
@@ -468,10 +468,20 @@ S_auth_server_authenticate (struct authhandle *serverauth,
 static int
 auth_demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp)
 {
-  extern int auth_server (mach_msg_header_t *inp, mach_msg_header_t *outp);
-  return (auth_server (inp, outp) ||
-         ports_interrupt_server (inp, outp) ||
-         ports_notify_server (inp, outp));
+  mig_routine_t auth_server_routine (mach_msg_header_t *);
+  mig_routine_t ports_notify_server_routine (mach_msg_header_t *);
+  mig_routine_t ports_interrupt_server_routine (mach_msg_header_t *);
+
+  mig_routine_t routine;
+  if ((routine = auth_server_routine (inp)) ||
+      (routine = ports_notify_server_routine (inp)) ||
+      (routine = ports_interrupt_server_routine (inp)))
+    {
+      (*routine) (inp, outp);
+      return TRUE;
+    }
+  else
+    return FALSE;
 }
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]