Forum: Ruby-dev [ruby-trunk - Bug #7924][Open] r39232 以降 net/http で正しく reponse を取得出来ないケースがある

Posted by hsbt (Hiroshi SHIBATA) (Guest)
on 2013-02-23 23:16
(Received via mailing list)
Issue #7924 has been reported by hsbt (Hiroshi SHIBATA).

----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Immediate
Assignee: naruse (Yui NARUSE)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by kazuhiko (Kazuhiko Shiozaki) (Guest)
on 2013-02-23 23:46
(Received via mailing list)
Issue #7924 has been updated by kazuhiko (Kazuhiko Shiozaki).


accept-encodingの無指定時に、http.rbのget()でaccept-encodingをつけていて、そのためにgeneric_request.rbが「あ、指定してるんならdecode_content=falseでいいよね」としているのが原因。

accept-encodingの無指定時に"gzip;q=1.0,deflate;q=0.6,identity;q=0.3"をセットするコードが、http.rbのget()とhttp/generic_request.rbのinitialize()の両方にあって、後者は前者の可能性を考慮していない。なので、この問題はputでは起きない。

その二箇所以外にaccept-encodingをセットしているコードはなさそうなので、http.rbのget()から「accept-encodingの無指定時に〜」を除けばなおるはず。
----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36837

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Immediate
Assignee: naruse (Yui NARUSE)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by kazuhiko (Kazuhiko Shiozaki) (Guest)
on 2013-02-23 23:47
(Received via mailing list)
Issue #7924 has been updated by kazuhiko (Kazuhiko Shiozaki).


問題になった r32932 ruby_2_0_0 にすでにマージされているので、このまま2.0.0を出すとけっこう影響の大きいバグだと思います。

----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36838

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Immediate
Assignee: naruse (Yui NARUSE)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by drbrain (Eric Hodel) (Guest)
on 2013-02-23 23:58
(Received via mailing list)
Issue #7924 has been updated by drbrain (Eric Hodel).


I found the bug, I will post a patch with a test momentarily.
----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36842

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Immediate
Assignee: naruse (Yui NARUSE)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by hsbt (Hiroshi SHIBATA) (Guest)
on 2013-02-24 00:03
(Received via mailing list)
Issue #7924 has been updated by hsbt (Hiroshi SHIBATA).

Assignee changed from naruse (Yui NARUSE) to drbrain (Eric Hodel)

translation of this issue: http://bugs.ruby-lang.org/issues/7831#note-10
----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36843

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Immediate
Assignee: drbrain (Eric Hodel)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by drbrain (Eric Hodel) (Guest)
on 2013-02-24 00:06
(Received via mailing list)
Issue #7924 has been updated by drbrain (Eric Hodel).

File net.http.bug7924.patch added

The attached patch removes the duplicated header setting in 
Net::HTTP#get and adds a test.

I double checked net/http* for use of accept-encoding or HAVE_ZLIB, now 
it only exists in Net::HTTPGenericRequest and Net::HTTPResponse.
----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36844

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Immediate
Assignee: drbrain (Eric Hodel)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by drbrain (Eric Hodel) (Guest)
on 2013-02-24 00:07
(Received via mailing list)
Issue #7924 has been updated by drbrain (Eric Hodel).

Assignee changed from drbrain (Eric Hodel) to naruse (Yui NARUSE)

assigned to Naruse-san for approval
----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36846

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Immediate
Assignee: naruse (Yui NARUSE)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by hsbt (Hiroshi SHIBATA) (Guest)
on 2013-02-24 00:15
(Received via mailing list)
Issue #7924 has been updated by hsbt (Hiroshi SHIBATA).


this patch seems good.
----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36849

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Immediate
Assignee: naruse (Yui NARUSE)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by nagachika (Tomoyuki Chikanaga) (Guest)
on 2013-02-24 01:26
(Received via mailing list)
Issue #7924 has been updated by nagachika (Tomoyuki Chikanaga).


make check all green with the patch in my environment 
[x86_64-darwin12.2.0].

----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36852

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Immediate
Assignee: naruse (Yui NARUSE)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by kosaki (Motohiro KOSAKI) (Guest)
on 2013-02-24 01:38
(Received via mailing list)
Issue #7924 has been updated by kosaki (Motohiro KOSAKI).


Please please make a test. for preventing regression.
----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36853

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Immediate
Assignee: naruse (Yui NARUSE)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by drbrain (Eric Hodel) (Guest)
on 2013-02-24 01:54
(Received via mailing list)
Issue #7924 has been updated by drbrain (Eric Hodel).


Kosaki-san, the patch contains a test to ensure that decode_content is 
enabled when using Net::HTTP#get.  The behavior of decode_content is 
already tested in r39232.

Is it sufficient?
----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36854

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Immediate
Assignee: naruse (Yui NARUSE)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by KOSAKI Motohiro (Guest)
on 2013-02-24 02:04
(Received via mailing list)
> Kosaki-san, the patch contains a test to ensure that decode_content is enabled 
when using Net::HTTP#get.  The behavior of decode_content is already tested in 
r39232.
>
> Is it sufficient?

Oops, I missed that. sorry for noise.
Posted by mame (Yusuke Endoh) (Guest)
on 2013-02-24 06:48
(Received via mailing list)
Issue #7924 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee changed from naruse (Yui NARUSE) to drbrain (Eric Hodel)

Looks serious.  Got ack from hsbt and nagachika.
Drbrain, could you please commit it to trunk and ruby_2_0_0 in advance?
I'll ask naruse-san to do post-review, if he could wake up early enough 
;-)

--
Yusuke Endoh <mame@tsg.ne.jp>
----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36892

Author: hsbt (Hiroshi SHIBATA)
Status: Assigned
Priority: Immediate
Assignee: drbrain (Eric Hodel)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by drbrain (Eric Hodel) (Guest)
on 2013-02-24 07:21
(Received via mailing list)
Issue #7924 has been updated by drbrain (Eric Hodel).


Also, r39464 for ruby_2_0_0 branch.
----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36894

Author: hsbt (Hiroshi SHIBATA)
Status: Closed
Priority: Immediate
Assignee: drbrain (Eric Hodel)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Posted by naruse (Yui NARUSE) (Guest)
on 2013-02-24 16:26
(Received via mailing list)
Issue #7924 has been updated by naruse (Yui NARUSE).


I see.
Thank you all and Happy Ruby 2.0!
----------------------------------------
Bug #7924: r39232 以降 net/http で正しく reponse を取得出来ないケースがある
https://bugs.ruby-lang.org/issues/7924#change-36941

Author: hsbt (Hiroshi SHIBATA)
Status: Closed
Priority: Immediate
Assignee: drbrain (Eric Hodel)
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-24 trunk 39439) [x86_64-darwin12.2.1]


r39232 以降、tDiary の以下のようなコードが動かなくなりました。

https://github.com/tdiary/tdiary-contrib/blob/mast...

単純に net/http を使用して flickr.com から xml を取得するコードですが、r39232で加えた
変更により、本来 inflate されるべき response.body が gzip の状態のままになっています。

response を inflate するケースの考慮漏れのような気がします。
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.