diff options
author | Derrell Lipman <derrell@samba.org> | 2006-09-03 00:50:34 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:39:48 -0500 |
commit | 40665edf5e6043ad5a8f46731a79ec1d5835b62a (patch) | |
tree | 269714d303f19434078233e8d25a5428348c7827 /source3/libsmb/clilist.c | |
parent | fea5d59b8411244b31df7980bdcdab9ed20dc712 (diff) | |
download | samba-40665edf5e6043ad5a8f46731a79ec1d5835b62a.tar.gz samba-40665edf5e6043ad5a8f46731a79ec1d5835b62a.tar.bz2 samba-40665edf5e6043ad5a8f46731a79ec1d5835b62a.zip |
r18011: Should fix bug 3835.
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.
Derrell
(This used to be commit fa664b24b829f973156486896575c1007b6d7b01)
Diffstat (limited to 'source3/libsmb/clilist.c')
-rw-r--r-- | source3/libsmb/clilist.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index 18c058f9df..22cb5930c2 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -349,10 +349,17 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute, mnt = cli_cm_get_mntpoint( cli ); - for (p=dirlist,i=0;i<total_received;i++) { - p += interpret_long_filename(cli,info_level,p,&finfo,NULL,NULL,NULL); - fn( mnt,&finfo, Mask, state ); - } + /* see if the server disconnected or the connection otherwise failed */ + if (cli_is_error(cli)) { + total_received = -1; + } else { + /* no connection problem. let user function add each entry */ + for (p=dirlist,i=0;i<total_received;i++) { + p += interpret_long_filename(cli, info_level, p, + &finfo,NULL,NULL,NULL); + fn( mnt,&finfo, Mask, state ); + } + } /* free up the dirlist buffer and last name raw blob */ SAFE_FREE(dirlist); |