From 0437af60d3bbf09003f3fd1fdb9993958fcd430d Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Thu, 29 Oct 2015 15:43:28 +0100 Subject: trans: improve demuxers 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. * trans/proxy-defpager.c (proxy_defpager_demuxer): Improve the demuxer function. * trans/streamio.c (demuxer): Likewise. --- trans/proxy-defpager.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'trans/proxy-defpager.c') diff --git a/trans/proxy-defpager.c b/trans/proxy-defpager.c index 662f2698..4fdeb35b 100644 --- a/trans/proxy-defpager.c +++ b/trans/proxy-defpager.c @@ -236,10 +236,16 @@ int proxy_defpager_demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp) { - extern int default_pager_server (mach_msg_header_t *, mach_msg_header_t *); - - return default_pager_server (inp, outp) - || trivfs_demuxer (inp, outp); + mig_routine_t routine; + if ((routine = default_pager_server_routine (inp)) || + (routine = NULL, trivfs_demuxer (inp, outp))) + { + if (routine) + (*routine) (inp, outp); + return TRUE; + } + else + return FALSE; } int -- cgit v1.2.3