[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 55/98: pflocal: improve the demuxer functions
From: |
Samuel Thibault |
Subject: |
[hurd] 55/98: pflocal: improve the demuxer functions |
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 b8b92e2455c2a9652e60a17dd38fc8dc031b77c3
Author: Justus Winter <address@hidden>
Date: Sat Nov 30 17:48:17 2013 +0100
pflocal: improve the demuxer functions
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.
* pflocal/pflocal.c (pf_demuxer): Improve the demuxer function.
* pflocal/sserver.c (sock_demuxer): Likewise.
---
pflocal/pflocal.c | 14 ++++++++++++--
pflocal/sserver.c | 25 +++++++++++++++++--------
2 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/pflocal/pflocal.c b/pflocal/pflocal.c
index 7a4e8d9..d51f721 100644
--- a/pflocal/pflocal.c
+++ b/pflocal/pflocal.c
@@ -51,8 +51,18 @@ int trivfs_cntl_nportclasses = 1;
static int
pf_demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp)
{
- extern int socket_server (mach_msg_header_t *inp, mach_msg_header_t *outp);
- return socket_server (inp, outp) || trivfs_demuxer (inp, outp);
+ mig_routine_t socket_server_routine (mach_msg_header_t *);
+
+ mig_routine_t routine;
+ if ((routine = socket_server_routine (inp)) ||
+ (routine = NULL, trivfs_demuxer (inp, outp)))
+ {
+ if (routine)
+ (*routine) (inp, outp);
+ return TRUE;
+ }
+ else
+ return FALSE;
}
diff --git a/pflocal/sserver.c b/pflocal/sserver.c
index 9de0aa5..4ce26b1 100644
--- a/pflocal/sserver.c
+++ b/pflocal/sserver.c
@@ -1,6 +1,6 @@
/* Server for socket ops
- Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1997, 2013 Free Software Foundation, Inc.
Written by Miles Bader <address@hidden>
@@ -36,13 +36,22 @@ static pthread_spinlock_t sock_server_active_lock =
PTHREAD_SPINLOCK_INITIALIZER
static int
sock_demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp)
{
- extern int socket_server (mach_msg_header_t *inp, mach_msg_header_t *outp);
- extern int io_server (mach_msg_header_t *inp, mach_msg_header_t *outp);
- return
- socket_server (inp, outp)
- || io_server (inp, outp)
- || ports_interrupt_server (inp, outp)
- || ports_notify_server (inp, outp);
+ mig_routine_t io_server_routine (mach_msg_header_t *);
+ mig_routine_t socket_server_routine (mach_msg_header_t *);
+ mig_routine_t ports_interrupt_server_routine (mach_msg_header_t *);
+ mig_routine_t ports_notify_server_routine (mach_msg_header_t *);
+
+ mig_routine_t routine;
+ if ((routine = io_server_routine (inp)) ||
+ (routine = socket_server_routine (inp)) ||
+ (routine = ports_interrupt_server_routine (inp)) ||
+ (routine = ports_notify_server_routine (inp)))
+ {
+ (*routine) (inp, outp);
+ return TRUE;
+ }
+ else
+ return FALSE;
}
/* Handle socket requests while there are sockets around. */
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 34/98: mach-defpager: drop all register qualifiers, (continued)
- [hurd] 34/98: mach-defpager: drop all register qualifiers, Samuel Thibault, 2014/01/13
- [hurd] 49/98: libdiskfs: improve the diskfs_demuxer function, Samuel Thibault, 2014/01/13
- [hurd] 56/98: auth: improve the auth_demuxer function, Samuel Thibault, 2014/01/13
- [hurd] 12/98: mach-defpager: remove unused variables, Samuel Thibault, 2014/01/13
- [hurd] 45/98: proc: store the privileged host port in _hurd_host_priv, Samuel Thibault, 2014/01/13
- [hurd] 36/98: libports: fix right leaks when adjusting priorities, Samuel Thibault, 2014/01/13
- [hurd] 65/98: trans: fix the use of the hash table in fakeroot.c, Samuel Thibault, 2014/01/13
- [hurd] 37/98: libshouldbeinlibc: fix minor port leak in maptime_map, Samuel Thibault, 2014/01/13
- [hurd] 38/98: init: fix port leak, Samuel Thibault, 2014/01/13
- [hurd] 68/98: trans: fix locking issue in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 55/98: pflocal: improve the demuxer functions,
Samuel Thibault <=
- [hurd] 57/98: utils: improve the auth_demuxer function in fakeauth.c, Samuel Thibault, 2014/01/13
- [hurd] 66/98: trans: improve the performance of dir_lookup in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 41/98: libports: improve error handling in ports_reallocate_from_external, Samuel Thibault, 2014/01/13
- [hurd] 40/98: libports: improve error handling in ports_reallocate_port, Samuel Thibault, 2014/01/13
- [hurd] 58/98: trans: remove unused declaration from fakeroot.c, Samuel Thibault, 2014/01/13
- [hurd] 72/98: trans: fix reference counting bug in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 39/98: proc: update comments, Samuel Thibault, 2014/01/13
- [hurd] 26/98: Make sure created netfs nodes have stat validated, Samuel Thibault, 2014/01/13
- [hurd] 53/98: proc: improve the message_demuxer function, Samuel Thibault, 2014/01/13
- [hurd] 04/98: utils: implement settrans --pid-file, Samuel Thibault, 2014/01/13