7月 122012
 

※ RFC7230 時点の情報に更新 → HTTP/1.1 のコネクション管理の理解メモ – CAT EARS

HTTPリクエストの処理中(長いAPサーバーの処理等)にタイムアウトなどでTCPコネクションが切断された場合、HTTPクライアントはRFC2616に従い同じリクエストを勝手に再送する事がある。(SHOLDとなっているのでその場合の方が多いかと)
なので、場合によっては二重POSTとなってしまう。。
非冪等メソッドの自動再試行は不可。

これはHTTPベースのプロトコル(SOAPやAMF、WebDAV等のRPC)全てに当てはまるため、RPCを使用する際には注意が必要である。
失敗パターンは リクエスト送信→失敗→再送信→失敗→切断(エラー?) が標準動作。

RFC2616 8.1.4 Practical Considerations より抜粋

A client, server, or proxy MAY close the transport connection at any
time. For example, a client might have started to send a new request
at the same time that the server has decided to close the “idle”
connection. From the server’s point of view, the connection is being
closed while it was idle, but from the client’s point of view, a
request is in progress.

This means that clients, servers, and proxies MUST be able to recover
from asynchronous close events. Client software SHOULD reopen the
transport connection and retransmit the aborted sequence of requests
without user interaction so long as the request sequence is
idempotent (see section 9.1.2). Non-idempotent methods or sequences
MUST NOT be automatically retried, although user agents MAY offer a
human operator the choice of retrying the request(s). Confirmation by
user-agent software with semantic understanding of the application
MAY substitute for user confirmation. The automatic retry SHOULD NOT
be repeated if the second sequence of requests fails.

参考:

7月 122012
 
  • コマンドの引数として渡されるFQDNの末尾にスペースかドットが付加された場合に発生する事が多い。
    →HELO、EHLO、MAIL FROMなどのコマンド
  • コード5.5.4は、RFC1893に定義されたとおり、コマンド引数が不正であり、送り先などを修正しなければ解決できそうにない恒久的なエラーを示す。
  • 大抵のSMTPサーバは末尾のスペースやドットを無視するが、RFC821および1869に厳しいサーバではエラーとなる事がある。
    →Microsoft Exchange 2000やMicrosoft Exchange Server 5.5 SP4など

参考:

7月 122012
 

FTPタスクが使用しているcommons-netライブラリが日本語環境のFTPに対応していない事が原因。
Antのドキュメントにも記載されている。

FTP Task

Warning: there have been problems reported concerning the ftp get with the newer attribute. Problems might be due to format of ls -l differing from what is expected by commons-net, for instance due to specificities of language used by the ftp server in the directory listing. If you encounter such a problem, please send an email including a sample directory listing coming from your ftp server (ls -l on the ftp prompt).

ファイル一覧を取得する際、日付が日本語で返されるとうまく解析できない模様。
また、Ant1.5以前はcommons-netではなくNetComponentsを使用するが、こちらでも同様の問題が発生する。

恐らく大抵のFTPクライアントは日本語環境のFTPサーバーに対応していない気がする…

対策
  • 方法1.ftp.exeを使う
    BATを書く要領で使える。多分。

  • 方法2.サーバー環境を変更する
    日付が英語で返されるようにすれば良い。

  • 方法3.commons-netを改造する
    面倒。

7月 122012
 

環境:Apache2.2.6@WindowsXP SP2

  1. substコマンドで仮想ドライブを作る
  2. httpd.confでDirectoryディレクティブで仮想ドライブ内のパスを指定
  3. エラーで起動できない

SVN+WebDAVの場合も、LocationディレクティブでSVNPathあるいはSVNParentPathに仮想ドライブを指定すると、Apacheの起動はできるがリポジトリの参照ができない。