proposal: libsmbclient functionality addition

Tom Jansen tom at ninja.nl
Tue Jun 18 01:54:02 GMT 2002


Hi Richard, samba-technical,

> > The most important part is detecting these disconnects and acting nice
> > upon occurance. I think there are two ways:
> > o A callback mechanism to give disconnect messages to the user
> >  (libsmbclient.c and user-written code).
> > o A simple check in smbc_server(): send keepalive packet and check
> >   cli->fd for errors (in all the clientcode I've seen, the fd is set to -1 >
>   on error).
> 
> Sending a keep-alive requires that you call down into libsmbclient every
> now and then from the application ... You should be able to detect that
> the connection has gone, as you indicate, on the next time you call down
> to libsmbclient. So, you might not need the keep-alive.

The keep-alive is useful for detecting that the remote end closed the
connection. If this has occured cli->fd == -1 afterwards. The keep-alive is the
most harmless packet IMHO so it is great for a test.

> However, from the point of view of GTK+ apps, it would be worth while 
> having that.

Something like smbc_check_server(char *srv, char* share, char *usr, char *pwd)
might be nice. It might contribute to a manual implementation.
 
> > I prefer the last for increased simplicity. Maybe the samba gurus disagree >
> but that's why I'm posting this here.
> > 
> > Is there any interest in such code? I'm quite happy to code it up and
> 
> Please go ahead. 

I will! expect patches soon.

> The next big set of changes I need to make are allowing one program to
> instantiate multiple clients. This is something that is needed ...

That would result in? reentrant code ? or just the cache lookup/maintenance
outside of libsmbclient.c? I've done some work on the last one but it's not done
yet.

> Regards

    Tom
--
Tom Jansen -- tom at ninja.nl     /"\  ASCII Ribbon Campaign
Ninja ISD  -- www.ninja.nl     \ /  No HTML or RTF in mail or news
                                X   No proprietary word-processing
Respect Open Standards         / \  files in mail or news




More information about the samba-technical mailing list