Re: [twmode-users] twittering-get-response- headerの修正
はやみずです > > 異常事態であることを検出できれば私は何を返してもよいと > > 思いますので、修正することに異論はありません。 > > ただ、使わないのであれば呼び出し側で間違えて使うことのない > ようにしておいた方が良いような気がしましたので。 > # 個人的にチェックし忘れることが多いので…。 単純にerrorを投げてしまうのが筋じゃないですかね。headerとbodyの区切りが 見付からない時点でレスポンスとして壊れてしまっているので、errorが自然で しょう。 At Thu, 31 Dec 2009 00:23:28 +0900 (JST), Tadashi MATSUO wrote: > > 松尾です。 > > > 異常事態であることを検出できれば私は何を返してもよいと > > 思いますので、修正することに異論はありません。 > > headerに関しては > (string-match "HTTP/1\.[01] \\([a-zA-Z0-9 ]+\\)\r?\n" header) > のチェックが入っているので、「空行なしでヘッダ部分だけ」や > 「一部にHTTP headerぽい文字列を含むデータ」のようなややこしい > 応答でなければ元々問題ないと思います。 > > ただ、使わないのであれば呼び出し側で間違えて使うことのない > ようにしておいた方が良いような気がしましたので。 > # 個人的にチェックし忘れることが多いので…。 > > > ただ、このtopic branchの先端では(message 〜)が追加されて > > いますが、twittering-get-response-header()の呼び出し元でも > > messageが呼び出されていて、すぐに上書きされてしまうので、 > > 前者はほとんど視認できないのではないかと思います。 > > これは気付いてませんでした。ご指摘ありがとうございます。 > twittering-get-response-body()で(message "Failure: %s" ...)と > なっていたのでそれに合わせたつもりでした。 > > twittering-http-get-list-index-sentinel()を見て出力されない > ものだとばかり思っていたのですが > twittering-other-user-list-interactive()の側で出力されていたの > ですね。*Messages* bufferに記録が残るというのはありますが、 > あまり意味なかったですね…。 > > --- > 松尾 直志 > > -- > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > ___ > twmode-users mailing list > twmode-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/twmode-users -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ twmode-users mailing list twmode-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/twmode-users
Re: [twmode-users] twittering-get-response- headerの修正
松尾です。 > 異常事態であることを検出できれば私は何を返してもよいと > 思いますので、修正することに異論はありません。 headerに関しては (string-match "HTTP/1\.[01] \\([a-zA-Z0-9 ]+\\)\r?\n" header) のチェックが入っているので、「空行なしでヘッダ部分だけ」や 「一部にHTTP headerぽい文字列を含むデータ」のようなややこしい 応答でなければ元々問題ないと思います。 ただ、使わないのであれば呼び出し側で間違えて使うことのない ようにしておいた方が良いような気がしましたので。 # 個人的にチェックし忘れることが多いので…。 > ただ、このtopic branchの先端では(message 〜)が追加されて > いますが、twittering-get-response-header()の呼び出し元でも > messageが呼び出されていて、すぐに上書きされてしまうので、 > 前者はほとんど視認できないのではないかと思います。 これは気付いてませんでした。ご指摘ありがとうございます。 twittering-get-response-body()で(message "Failure: %s" ...)と なっていたのでそれに合わせたつもりでした。 twittering-http-get-list-index-sentinel()を見て出力されない ものだとばかり思っていたのですが twittering-other-user-list-interactive()の側で出力されていたの ですね。*Messages* bufferに記録が残るというのはありますが、 あまり意味なかったですね…。 --- 松尾 直志 -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ twmode-users mailing list twmode-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/twmode-users
Re: [twmode-users] twittering-get-response- headerの修正
やたがわです。 > http://github.com/cvmat/twittering-mode/tree/fix-get-response 異常事態であることを検出できれば私は何を返してもよいと 思いますので、修正することに異論はありません。 ただ、このtopic branchの先端では(message 〜)が追加されて いますが、twittering-get-response-header()の呼び出し元でも messageが呼び出されていて、すぐに上書きされてしまうので、 前者はほとんど視認できないのではないかと思います。 > 松尾です。 > highmtさん、やたがわさん、ご指摘ありがとうございます。 > テスト時に使っていた変数名が残ってしまっていたようです。 > やたがわさんにはsearch-forward-regexp()のNOERRORオプ > ションの件でもお世話になりました。ありがとうございます。 > 今回のやたがわさんの修正ではHTTP headerの終了行が見つから > ない場合にbufferの内容全てを返すようになっていますが、 > 異常事態なので空文字列を返した方が良いんじゃないでしょうか。 > http://github.com/cvmat/twittering-mode/tree/fix-get-response > にcommitしてあります。 > twittering-get-response-body()の方も、終了行が見つからない > 場合にはxml-parse-region()を呼ばずにnilを返すようにして > みました。 > twittering-get-response-body()はwhenを使っても良いのですが > エラー時の返り値を明示する目的でifにしてあります。 > どうでしょうか。 > --- > 松尾 直志 > -- > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > ___ > twmode-users mailing list > twmode-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/twmode-users -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev ___ twmode-users mailing list twmode-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/twmode-users