[PHP-users 19225]Re: X-Pad: avoidbrowserbugとは?

Youichi Iwakiri yiwakiri @ st.rim.or.jp
2003年 12月 5日 (金) 13:05:47 JST


いわきりです

youichirou.suzuki wrote in <20031205124033.AF7B.YOUICHIROU.SUZUKI @ lac.co.jp> :
>PHPに関連あることだとは思うのですが、確証はもてません。

古いNavigatorのバグを回避するために、Apacheが
ダミーデータをパディングしています。

Navigator versions 2.x, 3.x and 4.0 betas up to and including 4.0b2
have a header parsing bug.  If the terminating \r\n occur starting
at offset 256, 257 or 258 of output then it will not properly parse
the headers.  Curiously it doesn't exhibit this problem at 512, 513.
We are guessing that this is because their initial read of a new request
uses a 256 byte buffer, and subsequent reads use a larger buffer.
So the problem might exist at different offsets as well.
This should also work on keepalive connections assuming they use the
same small buffer for the first read of each new request.
At any rate, we check the bytes written so far and, if we are about to
tickle the bug, we instead insert a bogus padding header.  Since the bug
manifests as a broken image in Navigator, users blame the server.  :(
It is more expensive to check the User-Agent than it is to just add the
bytes, so we haven't used the BrowserMatch feature here.

>動作等にはまったく影響ないのですが、気持ち悪いので理由を
>知りたいと思っています。

英文の出所は、
% find apache-1.3.xx -name "*.[ch]" -exec grep -l "X-Pad:" {} \;
です。


-- 
Youichi Iwakiri



PHP-users メーリングリストの案内