[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/4] lwip: refactor main demuxer to avoid code duplication
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 2/4] lwip: refactor main demuxer to avoid code duplication |
Date: |
Tue, 14 Aug 2018 00:36:03 +0200 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
Joan Lledó, le sam. 11 août 2018 18:17:08 +0200, a ecrit:
> * lwip/main.c (lwip_demuxer): Refactored.
Applied, thanks!
> ---
> lwip/main.c | 42 +++++++++++-------------------------------
> 1 file changed, 11 insertions(+), 31 deletions(-)
>
> diff --git a/lwip/main.c b/lwip/main.c
> index 9f7eb9b2..4dfbe143 100644
> --- a/lwip/main.c
> +++ b/lwip/main.c
> @@ -99,6 +99,7 @@ int
> lwip_demuxer (mach_msg_header_t * inp, mach_msg_header_t * outp)
> {
> struct port_info *pi;
> + mig_routine_t routine = NULL;
>
> /* Clear errno to prevent raising previous errors again */
> errno = 0;
> @@ -116,40 +117,19 @@ lwip_demuxer (mach_msg_header_t * inp,
> mach_msg_header_t * outp)
> if (pi)
> {
> ports_port_deref (pi);
> -
> - mig_routine_t routine;
> - if ((routine = lwip_io_server_routine (inp)) ||
> - (routine = lwip_socket_server_routine (inp)) ||
> - (routine = lwip_pfinet_server_routine (inp)) ||
> - (routine = lwip_iioctl_server_routine (inp)) ||
> - (routine = NULL, trivfs_demuxer (inp, outp)) ||
> - (routine = lwip_startup_notify_server_routine (inp)))
> - {
> - if (routine)
> - (*routine) (inp, outp);
> - return TRUE;
> - }
> - else
> - return FALSE;
> + routine = lwip_io_server_routine (inp);
> }
> - else
> +
> + if (routine || (routine = lwip_socket_server_routine (inp)) ||
> + (routine = lwip_pfinet_server_routine (inp)) ||
> + (routine = lwip_iioctl_server_routine (inp)) ||
> + (routine = lwip_startup_notify_server_routine (inp)))
> {
> - mig_routine_t routine;
> - if ((routine = lwip_socket_server_routine (inp)) ||
> - (routine = lwip_pfinet_server_routine (inp)) ||
> - (routine = lwip_iioctl_server_routine (inp)) ||
> - (routine = NULL, trivfs_demuxer (inp, outp)) ||
> - (routine = lwip_startup_notify_server_routine (inp)))
> - {
> - if (routine)
> - (*routine) (inp, outp);
> - return TRUE;
> - }
> - else
> - return FALSE;
> + (*routine) (inp, outp);
> + return TRUE;
> }
> -
> - return 0;
> + else
> + return trivfs_demuxer (inp, outp);
> }
>
> void
> --
> 2.11.0
>
>
--
Samuel
<s> T'as pas de portable ?
<m> J'ai un nokia, dans le bassin d'arcachon
- [PATCH 3/4] lwip: return EINTR when a select() IPC thread is cancelled, (continued)
- [PATCH 3/4] lwip: return EINTR when a select() IPC thread is cancelled, Joan Lledó, 2018/08/07
- [PATCH 2/4] lwip: refactor main demuxer to avoid code duplication, Joan Lledó, 2018/08/07
- [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings, Joan Lledó, 2018/08/07
- Re: Patches: lwip translator, Samuel Thibault, 2018/08/09
- [PATCH 2/4] lwip: refactor main demuxer to avoid code duplication, Joan Lledó, 2018/08/11
- Re: [PATCH 2/4] lwip: refactor main demuxer to avoid code duplication,
Samuel Thibault <=
- [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings, Joan Lledó, 2018/08/11
- Re: [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings, Samuel Thibault, 2018/08/14
- Re: [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings, Joan Lledó, 2018/08/14
- Re: [PATCH 4/4] lwip: Fix a buffer overflow and clear compiler warnings, Samuel Thibault, 2018/08/14