[#14696] Inconsistency in rescuability of "return" — Charles Oliver Nutter <charles.nutter@...>

Why can you not rescue return, break, etc when they are within

21 messages 2008/01/02

[#14738] Enumerable#zip Needs Love — James Gray <james@...>

The community has been building a Ruby 1.9 compatibility tip list on =20

15 messages 2008/01/03
[#14755] Re: Enumerable#zip Needs Love — Martin Duerst <duerst@...> 2008/01/04

Hello James,

[#14772] Manual Memory Management — Pramukta Kumar <prak@...>

I was thinking it would be nice to be able to free large objects at

36 messages 2008/01/04
[#14788] Re: Manual Memory Management — Marcin Raczkowski <mailing.mr@...> 2008/01/05

I would only like to add that RMgick for example provides free method to

[#14824] Re: Manual Memory Management — MenTaLguY <mental@...> 2008/01/07

On Sat, 5 Jan 2008 15:49:30 +0900, Marcin Raczkowski <mailing.mr@gmail.com> wrote:

[#14825] Re: Manual Memory Management — "Evan Weaver" <evan@...> 2008/01/07

Python supports 'del reference', which decrements the reference

[#14838] Re: Manual Memory Management — Marcin Raczkowski <mailing.mr@...> 2008/01/08

Evan Weaver wrote:

[#14911] Draft of some pages about encoding in Ruby 1.9 — Dave Thomas <dave@...>

Folks:

24 messages 2008/01/10

[#14976] nil encoding as synonym for binary encoding — David Flanagan <david@...>

The following just appeared in the ChangeLog

37 messages 2008/01/11
[#14977] Re: nil encoding as synonym for binary encoding — Yukihiro Matsumoto <matz@...> 2008/01/11

Hi,

[#14978] Re: nil encoding as synonym for binary encoding — Dave Thomas <dave@...> 2008/01/11

[#14979] Re: nil encoding as synonym for binary encoding — David Flanagan <david@...> 2008/01/11

Dave Thomas wrote:

[#14993] Re: nil encoding as synonym for binary encoding — Dave Thomas <dave@...> 2008/01/11

[#14980] Re: nil encoding as synonym for binary encoding — Gary Wright <gwtmp01@...> 2008/01/11

[#14981] Re: nil encoding as synonym for binary encoding — Yukihiro Matsumoto <matz@...> 2008/01/11

Hi,

[#14995] Re: nil encoding as synonym for binary encoding — David Flanagan <david@...> 2008/01/11

Yukihiro Matsumoto writes:

[#15050] how to "borrow" the RDoc::RubyParser and HTMLGenerator — Phlip <phlip2005@...>

Core Rubies:

17 messages 2008/01/13
[#15060] Re: how to "borrow" the RDoc::RubyParser and HTMLGenerator — Eric Hodel <drbrain@...7.net> 2008/01/14

On Jan 13, 2008, at 08:54 AM, Phlip wrote:

[#15062] Re: how to "borrow" the RDoc::RubyParser and HTMLGenerator — Phlip <phlip2005@...> 2008/01/14

Eric Hodel wrote:

[#15073] Re: how to "borrow" the RDoc::RubyParser and HTMLGenerator — Eric Hodel <drbrain@...7.net> 2008/01/14

On Jan 13, 2008, at 20:35 PM, Phlip wrote:

[#15185] Friendlier methods to compare two Time objects — "Jim Cropcho" <jim.cropcho@...>

Hello,

10 messages 2008/01/22

[#15194] Can large scale projects be successful implemented around a dynamic programming language? — Jordi <mumismo@...>

A good article I have found (may have been linked by slashdot, don't know)

8 messages 2008/01/24

[#15248] Symbol#empty? ? — "David A. Black" <dblack@...>

Hi --

24 messages 2008/01/28
[#15250] Re: Symbol#empty? ? — Yukihiro Matsumoto <matz@...> 2008/01/28

Hi,

Re: Zlib::Inflate changes to net/http.rb

From: Hugh Sasse <hgs@...>
Date: 2008-01-09 12:25:12 UTC
List: ruby-core #14893
On Fri, 28 Dec 2007, Filipe Lautert wrote:

> 
> Hi,
> 
> from ruby 1.8 to 1.9, NET::HTTP.get method improved a lot, and now it has
> support to compression, that is really good.
> 
> There is just one small "problem" with content-encoding = deflate
> (lib/net/http.rb:817): it works as defined by the specification.
> 
> But some browsers/servers have problem with this, as stated in zib site [1]:
> 'While the HTTP 1.1 RFC 2616 correctly points to the zlib specification in RFC
> 1950 for the "deflate" transfer encoding, there have been reports of servers
> and browsers that incorrectly produce or expect raw deflate data per the
> deflate specficiation in RFC 1951, most notably Microsoft. '
> 
> And mongrel too :) And apache mod_deflate default configuration too (2) -
> those are just some examples.

At the time of implementing this I pointed out that I was unable to
find any servers supporting deflate at all -- including W3C servers.
Are there any on line that I can actually test against?

> mongrel uses raw deflate instead of zlib because it had problems with IE and
> safari browsers when sendind correct zlib data. And as mongrel, many other
> guys (apache, for instance) are using raw deflate by default, because it is
> wrong but "just works".
> 
> The patch that follow change NET::HTTP.get to first try the correct Zlib
> format. If it fails, then try the raw deflate format:

I don't have final say on this of course but I'd be happy about this
patch.  I'd suggest you include the URL's in the comments as well,
and the remark about windowsize being negative.

> Index: lib/net/http.rb
> ===================================================================
> --- lib/net/http.rb     (revision 14746)
> +++ lib/net/http.rb     (working copy)
> @@ -815,7 +815,13 @@
>              r.body= Zlib::GzipReader.new(StringIO.new(the_body)).read
>              r.delete("content-encoding")
>            when "deflate"
> -            r.body= Zlib::Inflate.inflate(the_body);
> +           begin
> +              r.body= Zlib::Inflate.inflate(the_body);
> +           rescue Zlib::DataError
> +             #no luck with Zlib decompression. Let's try with raw deflate,
> +             #like some broken browsers do.
> +              r.body= Zlib::Inflate.new(-Zlib::MAX_WBITS).inflate(the_body);
> +           end
>              r.delete("content-encoding")
>            when "identity"
>              ; # nothing needed
> 
> 
> 
> 1. http://www.gzip.org/zlib/zlib_faq.html#faq38
> 2.
> https://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_deflate.c?revision=581198&view=markup
> (search for "windowsize is negative to suppress Zlib header")
> 
> Cheers,
> 
> filipe
> 
        Thank you,
        Hugh

In This Thread

Prev Next