Hi Alexander,

It looks like there are a couple of different problems with HttpDir, however
I wasn't able to trace all of them.

The first issue is that lftp is parsing the same "directory" differently,
depending on which commands were typed before:

lftp :~> open http://localhost/main/
cd ok, cwd=/main
lftp localhost:/main> ls
drwxr-xr-x  --  ..
drwxr-xr-x  --  . 
drwxr-xr-x  --  /main/dir1
drwxr-xr-x  --  /main/dir2
drwxr-xr-x  --  /main/dir3
lftp localhost:/main> cd dir1
cd: received redirection to 'http://localhost/main/dir1/'
cd ok, cwd=/main/dir1
lftp localhost:/main/dir1> cd ..
cd ok, cwd=/main
lftp localhost:/main> ls
drwxr-xr-x  --  .
drwxr-xr-x  --   
drwxr-xr-x  --  dir1
drwxr-xr-x  --  dir2
drwxr-xr-x  --  dir3
lftp localhost:/main>


Please note that ".." and "." entries are different as well.

Webpage used at "main/index.html" was:
<html>
<a href="/main/">main1</a>
<a href="/main//">main2</a><br>
<a href="/main/dir1/">dir1</a><br>
<a href="/main/dir2/">dir2</a><br>
<a href="/main/dir3/">dir3</a><br>
</html>

The patch you provided makes the "" entry disappear and then mirror starts
working. 

However when mirroring is interruppted and then re-started, it's attempting
to download files from wrong directories. (I.e. it's using list of files
from dir1 and is trying to get those files from dir2.) Unfortunatelly this
problem is not very stable and I haven't found a way to reliably reproduce
it yet.

Could it be possible for you to check why lftp shows different output in the
example above?

Also I think lftp should treat "//" as "/" (as this is normal in UNIX
enviroment) instead of removing the empty paths at the end.

Thanks!

 >>> As a result, lftp was sitting in dir1 and doing just "Mirroring
 >>> directory `'" all the time, eating more and more memory.
 >> 
 >> Does this patch help?

-- 
Michael

Reply via email to