-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
tdiary-users掲示板で報告あり。
http://tdiary-users.sourceforge.jp/cgi-bin/wforum/wforum.cgi?mode=allread&no=6559&page=0
【症状】
emacsのtdiary-modeのtdiary-replaceを実行するとミニバッファに、
tDiary POST: nil - nil
と表示され、日記の更新ができず困っています。
- tdiary: tDiary version 3.1.2
- ruby : Powered by Ruby version 1.8.2
- emacs : GNU Emacs 24.0.91.1 (i386-mingw-nt5.1.2600) of 2011-11-03 on GNUPACK
- tdiary-mode: tdiary-contrib.tar.gzの中のutil/tdiary-modeに含まれるもの
- apache: Apache/1.3.41
- tdiaryの設定で「Refererチェックによる防衛」のところは、
** Refererの正当性の検査: する
** Refererを送出しないブラウザを拒否: する
** CSRF防止キーによる防衛: する
↑この辺り、よく理解できていません。
【状況】
- これまでtDiaryの3.0.1で、emacsのtdiary-modeを使って日記の更新ができていたのですが、おそらく昨日3.1.2にバージョンアップしたところでtdiary-modeでの日記の更新ができなくなってます。
- ブラウザやposttdiary-exからは日記の更新が可能な状態です。
- 「CSRF攻撃対策あたりの関係かな~」と思いつつ、理解が十分でなく行き詰っています。
- 今後もemacsのtdiary-modeで日記の更新をできるようにしたいので、助けてもらえないでしょうか。情報不足の部分があればご指摘下さい。なんとかします。以下、出来る範囲で調べてみた内容です。
以下のtdiary-mode.elの関数"tdiary-post"の中でL372行目に至り、
"tDiary POST: nil -nil"
のメッセージを出している状況と思います。
tdiary-mode.el :
L364: (if (bufferp buf)
L365: (save-excursion
L366: (tdiary-passwd-cache-save url user pass)
L367: (set-buffer buf)
L368: (decode-coding-region (point-min) (point-max) tdiary-coding-system)
L369: (goto-char (point-min))
L370: buf)
L371: (tdiary-passwd-cache-clear url)
L372: (error "tDiary POST: %s - %s" (car buf) (cdr buf)))))
さらにEdebugで、http.elの関数"http-fetch"のL121行目を実行したところで、
Result: nil
になっているようでした。
http.el :
L114: (goto-char (point-min))
L115: (while (not (search-forward http-fetch-terminator nil t))
L116: (unless (accept-process-output connection http-timeout)
L117: (error "HTTP fetch: Connection timeout!"))
L118: (goto-char (point-min)))
L119: (goto-char (point-min))
L120: (save-excursion
L121: (if (re-search-forward "HTTP/1.[01] \\([0-9][0-9][0-9]\\) \\(.*\\)" nil t)
L122: (let ((code (match-string 1))
L123: (desc (match-string 2)))
L124: (cond ((equal code "200")
L125: buf)
L126: (t
L127: (cons code desc)))))))))
一方、同じサーバで、
- tdiary: tDiary version 3.0.0
- ruby : Powered by Ruby version 1.8.2
というのが別途あり、こちらへは、emacsのtdiary-modeで日記の更新が可能な状態です。
こちらは上記のhttp.elの同じ所(L121)で、
Result: 17 (#o21, #x11, ?\C-q)
[3 times]
Result: "200"
[2 times]
Result: "OK
"
[3 times]
Result: "200"
となり、サーバからHTTPのステータスコードはちゃんと出ているようでした。
Metadata
Metadata
Assignees
Labels
No labels