Make libsmbclient more fail-safe

Tom Jansen t.p.j.jansen at student.utwente.nl
Thu Nov 29 12:06:37 GMT 2001


Jeremy Allison wrote:
> 
> On Thu, Nov 29, 2001 at 08:52:17PM +1100, Andrew Bartlett wrote:
> 
> > But a 'my connection went away and you asked me to do somthing' callback
> > mechinism would make sense, would it not?

[snip]

> Adding such a callback is not useful. The application has
> to keep the state. Calling back into the app. from libsmb
> client just doesn't seem worth the effort here.

Ehm, I think there is a little misunderstanding here. The callback should not go
into the app. but into the libsmbclient.c code. It would have been called on a
connection failure in cli_[send|receive]_smb()

> Look at a standard (ONC) RPC library. There are no callbacks
> for connection failure, just error codes from the calls.

I did not look but I'll take your word for this since you are the guru, not me.

> As the library has to punt anything useful back to the
> application anyway, callbacks just complicate the client
> code for no real gain (IMHO).

I do not agree with you on the gain point. If the client provides a configurable
safety, application development with libsmbclient can speed up quite a bit.

Of course, the code should not get too complicated but libsmbclient is quite
clear at the moment and I should be able to keep it that way.

And on the other hand, if my patch would not make it into the Samba tree, it
would be no problem, I'm having fun coding it and looking into the bowels of
Samba client functions :-)

Yours,

	Tom




More information about the samba-technical mailing list