svn commit: samba r18011 - in branches/SAMBA_3_0: examples/libsmbclient source/libsmb

Jeremy Allison jra at samba.org
Sun Sep 3 01:22:51 GMT 2006


On Sun, Sep 03, 2006 at 12:50:36AM +0000, derrell at samba.org wrote:
> 
> Jeremy: requires your eyes...
> 
> If the remote connection timed out while cli_list() was retrieving its list of
> files, the error was not returned to the user, e.g. via smbc_opendir(), so the
> user didn't have a way to know to set the timeout longer and try again.  This
> problem would occur when a very large directory is being read with a too-small
> timeout on the cli.
> 
> Jeremy, although there were a couple of areas that needed to be handled, I
> needed to make one change that you should bless, in libsmb/clientgen.c.  It
> was setting
> 
>   cli->smb_rw_error = smb_read_error;
> 
> but smb_read_error is zero, so this had no effect.  I'm now doing
> 
>   cli->smb_rw_error = READ_TIMEOUT;
> 
> instead, and according to the OP, these (cumulative) changes (in a slightly
> different form) solve the problem.
> 
> Please confirm this smb_rw_error change will have no other adverse effects
> that you can see.

The change shouldn't have any adverse effects, but what I'm
curious about is why 'smb_read_error' was zero at that point ?

All paths through that code should end up setting 'smb_read_error'
nonzero on error or timeout. Did you reproduce this ? Is so, set
the debugger to break on "read_socket_with_timeout()" and walk
through the function. Tell me how it exits on timeout with
smb_read_error == 0. That's where the real bug is. The patch
you added may just be a band-aid on this.

Jeremy.



More information about the samba-technical mailing list