Re: lftp 3.1 : problem with webdav MOVE

nodens <[email protected]>
Newsgroups gmane.network.lftp.devel
Message-ID <[email protected]>
Hi Alexander, and thanks for your quick response :)

Alexander V. Lukyanov wrote:

>Does this patch fix the problem?
>  
>
Sort of. This particular problem is fixed, but two other problems show up :

1) The Destination: header must be the complete path to new destination.
Giving a collection (directory) as argument will overwrite the collection.

so, if I want to move testfile in directory "/test", Destination: must
be as follow :

Destination: http://user@host/test/testfile

So we must first test if the destination is a directory, and appending
the filename to the directory URI eventually. At least, this must be
done to provide a consistent interface accross protocols. This is a
webdav limitation but the clients I have tested do it that way. We could
imagine a "rename" command wich do overwrite the destination if it's a
directory, but I don't see it as a must-have.

2) when moving a file, lftp wait forever after receiving the response
from server (unless it is an error). The command must be interrupted
with ctrl+c :

* success :

prompt> mv testfile test/testfile
---> MOVE /extended/upload/testfile HTTP/1.1
---> Host: webdav.example.com
---> User-Agent: lftp/3.1.0
---> Accept: */*
---> Destination:
https://[email protected]/extended/upload/test/testfile
---> Authorization: Basic bGludXhtb3ZpZXotZXh0ZW5kZWQ6ZS1qYWhzdXh4IQ==
---> Connection: keep-alive
--->
<--- HTTP/1.1 201 Created
<--- Date: Wed, 02 Mar 2005 16:19:04 GMT
<--- Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-7
mod_ssl/2.8.22 OpenSSL/0.9.7d mod_perl/1.29 DAV/1.0.3
<--- Keep-Alive: timeout=15, max=99
<--- Connection: Keep-Alive
<--- Transfer-Encoding: chunked
<--- Content-Type: text/html; charset=iso-8859-1
<---
[Receiving data]
<---Hit ctrl+c--->
Interrupt
prompt>

* Fail :
lftp [email protected]:/extended/upload> mv wrongname test/testfile
---- Connecting to webdav.example.com (192.168.0.69) port 443
---> MOVE /extended/upload/wrongname HTTP/1.1
---> Host: webdav.example.com
---> User-Agent: lftp/3.1.0
---> Accept: */*
---> Destination:
https://[email protected]/extended/upload/test/testfile
---> Authorization: Basic bGludXhtb3ZpZXotZXh0ZW5kZWQ6ZS1qYWhzdXh4IQ==
---> Connection: keep-alive
--->
Certificate depth: 0; subject:
/C=FR/ST=''/L=Grenoble/O=example.com/OU=Repository/CN=plop.example.com/emailAddress=clement.herma\[email protected];
issuer: /C=FR/ST=''/L=Grenoble/O=example.com/OU=Certificate
Authority/CN=example.com CA/[email protected]
WARNING: Certificate verification: unable to get local issuer certificate
WARNING: Certificate verification: certificate not trusted
WARNING: Certificate verification: unable to verify the first certificate
<--- HTTP/1.1 404 Not Found
<--- Date: Wed, 02 Mar 2005 17:12:35 GMT
<--- Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-7
mod_ssl/2.8.22 OpenSSL/0.9.7d mod_perl/1.29 DAV/1.0.3
<--- Keep-Alive: timeout=15, max=99
<--- Connection: Keep-Alive
<--- Transfer-Encoding: chunked
<--- Content-Type: text/html; charset=iso-8859-1
<---
Access failed: 404 Not Found (wrongname)
lftp [email protected]:/extended/upload>


(no waiting here).

>>the Destination could even be another server. This is not handled by
>>    
>>
>
>It could only be done as quote command extension. Same for COPY request.
>
>  
>
OK. Thanks for the workaround.

Best regards,
-- 
Clement 'nodens' Hermann
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.