smbd_open_one_socket does not use the messaging_context variable so why pass it in?

Andrew Bartlett abartlet at samba.org
Tue Nov 13 16:15:24 MST 2012


On Wed, 2012-11-14 at 10:13 +1100, Andrew Bartlett wrote:
> On Tue, 2012-11-13 at 14:34 -0800, Jeremy Allison wrote:
> > On Sun, Nov 11, 2012 at 09:59:22AM -0800, Richard Sharpe wrote:
> > > Hi folks,
> > > 
> > > I notice that smbd_open_one_socket does not use the messaging context,
> > > so I suggest this patch:
> > > 
> > > [rsharpe at localhost source3]$ git diff smbd/server.c
> > > diff --git a/source3/smbd/server.c b/source3/smbd/server.c
> > > index 7113eae..1cd9288 100644
> > > --- a/source3/smbd/server.c
> > > +++ b/source3/smbd/server.c
> > > @@ -551,7 +551,7 @@ static void smbd_accept_connection(struct tevent_context *ev
> > >                 return;
> > > 
> > >         if (fd == -1) {
> > > -               DEBUG(0,("open_sockets_smbd: accept: %s\n",
> > > +               DEBUG(0,("accept: %s\n",
> > >                          strerror(errno)));
> > >                 return;
> > >         }
> > > @@ -662,7 +662,6 @@ static void smbd_accept_connection(struct tevent_context *ev
> > > 
> > >  static bool smbd_open_one_socket(struct smbd_parent_context *parent,
> > >                                  struct tevent_context *ev_ctx,
> > > -                                struct messaging_context *msg_ctx,
> > >                                  const struct sockaddr_storage *ifss,
> > >                                  uint16_t port)
> > >  {
> > > @@ -792,7 +791,6 @@ static bool open_sockets_smbd(struct smbd_parent_context *pa
> > > 
> > >                                 if (!smbd_open_one_socket(parent,
> > >                                                           ev_ctx,
> > > -                                                         msg_ctx,
> > >                                                           ifss,
> > >                                                           port)) {
> > >                                         return false;
> > > @@ -834,7 +832,6 @@ static bool open_sockets_smbd(struct smbd_parent_context *pa
> > > 
> > >                                 if (!smbd_open_one_socket(parent,
> > >                                                           ev_ctx,
> > > -                                                         msg_ctx,
> > >                                                           &ss,
> > >                                                           port)) {
> > >                                         return false;
> > 
> > Pushed to autobuild.
> 
> I was curious about this (and wondering if it was part of a
> half-completed effort), so I looked into it.  In fact, it looks like it
> was left over from when metze did:
> 
> commit dc38db31ba3166148e41f7551b5160cc761f93f2
> Author: Stefan Metzmacher <metze at samba.org>
> Date:   Tue Dec 13 08:31:09 2011 +0100
> 
>     s3:smbd/server: remember the ev_ctx on the smbd_parent_context
>     
>     metze

Sorry, copied out the wrong header, it was:

commit 20c343b8e89df2b87b40b38017b77fa342640f8c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Dec 13 08:30:39 2011 +0100

    s3:smbd/server: remember the msg_ctx on the smbd_parent_context
    
    metze

Andrew Bartlett


-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org




More information about the samba-technical mailing list