Make libsmbclient more fail-safe

Jeremy Allison jra at
Thu Nov 29 11:11:08 GMT 2001

On Thu, Nov 29, 2001 at 11:15:18AM +0100, Tom Jansen wrote:

> No, that is true... but I was thinking in another direction:
> libsmbclient.c code detects _server_ connection error and tries to reestablish
> the connection because the server could have timed out or has been restarted.
> Libsmbclient.c would then call cli_reestablish_connection(cli) which tries to
> reestablish an identical connection to the server that failed. If it does not
> succeed, there is nothing more we can do and all open smbc_fds for that
> connection are useless. If it does succeed libsmbclient could try to first
> smbc_close() and later smbc_open() the file again. This behaviour should be
> configurable using some mechanism. I was thinking about an ioctl() like
> interface: smbc_ctl(int smbc_fd, int request, ...) so it is expandable in the
> future.
> Please tell me what you think about this.

It's not workable I'm afraid. FID's are dependent on TID's,
all TID's will be lost once a connection goes down. TID's
are allocated by the server.

You can re-open a connection buit it gives you nothing. The
application still has to re-open all the resources. It just
complicates the libsmb code for no gain.


More information about the samba-technical mailing list