0

私の考えはLOCK、apache/WebDAV サーバー上のファイル、PUTサーバー上の更新バージョン、およびUNLOCKその後のファイルです。

死体で次のことを試しました:

  1. A.txtコンテンツを含むファイルを作成するa file
  2. GETA.txt得られるファイルa file
  3. 編集A.txtしてupdated file保存します(死体に)
  4. GET生成されるファイルA.txtはまだ生成されますa file
  5. 死体の編集を閉じる (VIM)
  6. GETA.txt得られるファイルupdated file

内部的に死体LOCKがファイルであると推測し、GETそれをローカルで変更します。それからそれはPUTそれUNLOCKです。

質問: curl でこれを行うにはどうすればよいですか?

問題: 接続が遅く、PUTまだ完全にアップロードされていないファイルに対して を実行すると、まだアップロードされている部分しか取得できません。新しいのが完成しない限り、古いのを手に入れたいです。

試してみました:手動で(つまり、cURLを使用して)ファイルをロックするために、次のことを試みました:

curl -v -X LOCK --user "user:password" http://myServer/newFile

私が得るものは次のとおりです。

* About to connect() to myServer port 80 (#0)
*   Trying xx.xx.xxx.xxx... connected
* Connected to myServer (xx.xx.xxx.xxx) port 80 (#0)
* Server auth using Basic with user 'user'
> LOCK /newFile HTTP/1.1
> Authorization: Basic xxxxxxxxxxxxxxxxx
> User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.21.6 OpenSSL/1.0.0e zlib/1.2.3.4 libidn/1.22 librtmp/2.3
> Host: myServer
> Accept: */*
> 
< HTTP/1.1 400 Bad Request
< Date: Wed, 02 May 2012 15:20:55 GMT
< Server: Apache/2.2.3 (CentOS)
< Content-Length: 226
< Connection: close
< Content-Type: text/html; charset=iso-8859-1
< 
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>
* Closing connection #0

私が見つけたApacheログファイルを見る:

[Wed May 02 15:20:55 2012] [error] [client xx.xx.xxx.xxx] The lock refresh for /newFile failed because no lock tokens were specified in an "If:" header.  [400, #0]
[Wed May 02 15:20:55 2012] [error] [client xx.xx.xxx.xxx] (20)Not a directory: No locktokens were specified in the "If:" header, so the refresh could not be performed.  [400, #103]

ヒントをありがとう!!

更新:問題の説明を追加しました..乾杯!

4

1 に答える 1