<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Laughing Meme &#187; gzip</title>
	<atom:link href="http://laughingmeme.org/tag/gzip/feed/" rel="self" type="application/rss+xml" />
	<link>http://laughingmeme.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 02 Apr 2012 20:12:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Magpie, PHP 4.3.2 Memory Error, an Update</title>
		<link>http://laughingmeme.org/2003/06/25/magpie-php-432-memory-error-an-update/</link>
		<comments>http://laughingmeme.org/2003/06/25/magpie-php-432-memory-error-an-update/#comments</comments>
		<pubDate>Wed, 25 Jun 2003 20:49:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[bug]]></category>
		<category><![CDATA[fof]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[magpie]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=490</guid>
		<description><![CDATA[Steve tracked down the root of the problem that is causing MagpieRSS to run out of memory after upgrading to 4.3.2. It lies in my (apparently dodgy) patch to Snoopy to add gzip support. Temporary Solution To turn off gzip encoding (and thereby avoid this bug) add: define('MAGPIEUSEGZIP', false); to the top of your script. [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://minutillo.com/steve/weblog/">Steve</a> tracked down the root of the problem that is causing MagpieRSS to run out of memory after upgrading to 4.3.2.  It lies in my (apparently dodgy) patch to Snoopy to add gzip support.
</p>

<p><p>
<h3>Temporary Solution</h3>
To turn off gzip encoding (and thereby avoid this bug) add:
<p> 
<code>
define('MAGPIE<em>USE</em>GZIP', false);
</code>
</p>
to the top of your script.
</p></p>

<p>
<h3>Explanation</h3>
After much hair pulling trying to get gzip encoding working in PHP, I found this magic recipe in <a href=" http://www.php.net/manual/en/function.gzencode.php">comments attached to gzencode</a>:
<p>
<code>
 $results = substr($results, 10);
 $results = gzinflate($results);
</code>
</p>
Seems you had to strip off the gzip header to make it work.  This was confirmed when I found <a href="http://simon.incutio.com/">Simon&#8217;s</a> <a href="http://scripts.incutio.com/httpclient/">httpClient</a>.
</p>

<p><p>
Apparently this is changed in 4.3.2, and stripping the first 10 characters leads eventually (through a yet untraced path) to an out of memory error.
</p>
<p>
<h3>Next Steps</h3>
Does anyone have any info about this?  Any suggestions on a good way to support 4.3.2 and pre-4.3.2 PHPs?  Gzip encoding really isn&#8217;t an optional feature in a modern aggregator, so turning it off is a short term solution.
</p>
<p>
<h3>Update 6/25 2:16</h3>
Okay, so I&#8217;ve got PHP 4.2.3 locally now (via <a href="http://www.entropy.ch/software/macosx/php/">Marc Liyanage&#8217;s excellent package</a>), and I&#8217;m seeing similar behaviour.  I don&#8217;t actually get an out of memory error, but I can see memory usage spike (with iPulse) and I get a warning about a gzinflate buffer error.  Unforunately  removing &#8220;$results = substr($results, 10);&#8221; <b>does not</b> fix the problem for me.  So currently the only solution is to turn gzip encoding off <img src='http://laughingmeme.org/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> 
 </p>
<p>
<h3>Curiouser and Curiouser</h3>
So removing the substr() call changed the error message form &#8220;gzinflate(): buffer error&#8221;, to &#8220;gzinflate(): data error&#8221;.  However only for certain websites!  Files served with gzip encoding from some sites (<a href="http://dev.protest.net/~kellan/cvs-rss/">like mine</a>) work, but from others, it doesn&#8217;t.  Ack. 
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2003/06/25/magpie-php-432-memory-error-an-update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MagpieRSS 0.5.1</title>
		<link>http://laughingmeme.org/2003/06/12/magpierss-051/</link>
		<comments>http://laughingmeme.org/2003/06/12/magpierss-051/#comments</comments>
		<pubDate>Fri, 13 Jun 2003 06:21:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[gzip]]></category>
		<category><![CDATA[magpie]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=468</guid>
		<description><![CDATA[MagpieRSS 0.5.1 is out with a fix for the gzip silent failure bug that showed up when attempting to fetch an RSS file with gzip encoding when PHP had been built without zlib support. Also include random other small clean up. Btw, that also means Magpie now runs on OS X&#8217;s stock Apache/PHP.]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://sourceforge.net/project/showfiles.php?group_id=55691&#038;release_id=165249">MagpieRSS 0.5.1</a> is out with a fix for the <a href="http://laughingmeme.org/archives/000811.html">gzip silent failure bug</a> that showed up when attempting to fetch an RSS file with gzip encoding when PHP had been built without zlib support.  Also include random other small clean up.
</p>

<p><p>
Btw, that also means Magpie now runs on OS X&#8217;s stock Apache/PHP.
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2003/06/12/magpierss-051/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magpie GZIP Bug</title>
		<link>http://laughingmeme.org/2003/05/30/magpie-gzip-bug/</link>
		<comments>http://laughingmeme.org/2003/05/30/magpie-gzip-bug/#comments</comments>
		<pubDate>Fri, 30 May 2003 20:27:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[bug]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[magpie]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=457</guid>
		<description><![CDATA[MagpieRSS 0.5 can fail without errors when fetching a RSS feed using GZIP encoding if your PHP doesn&#8217;t support gzinflate() (i.e. it hasn&#8217;t been built with --with-zlib) As of 0.5 sends an &#8220;Accept-encoding: gzip&#8221; header by default when fetching RSS files. You turn this feature off by adding define(MAGPIEUSEGZIP, 0) to the top of your [...]]]></description>
			<content:encoded><![CDATA[<p>
MagpieRSS 0.5 can fail without errors when fetching a RSS feed using GZIP encoding if your PHP doesn&#8217;t support <code>gzinflate()</code> (i.e. it hasn&#8217;t been built with <code>--with-zlib</code>)
</p>

<p><p>
As of 0.5 sends an &#8220;Accept-encoding: gzip&#8221; header by default when fetching RSS files.  You turn this feature off by adding <code>define(MAGPIE<em>USE</em>GZIP, 0)</code> to the top of your script.
</p>
<p>
A patched version of the locally maintained <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/magpierss/magpierss/extlib/Snoopy.class.inc">extlib/Snoopy.class.inc</a> 
that checks <code>function_exists(gzinflate)</code> is available in <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/magpierss/magpierss/extlib/Snoopy.class.inc">CVS</a>.
This fix seems to work, I haven&#8217;t had a chance to test it widely.  It is a busy week, but I&#8217;ll try to have a final fix, and new version out in the next couple of days.
<p>
(sidenote:  It seems silly to fork Snoopy, and give it a new name over one minor change like adding gzip support however development on Snoopy has stopped and its confusing this maintaing a local version because I don&#8217;t want to imply there is a bug with the real <a href="http://snoopy.sf.net">Snoopy</a>, just my version.  What do you think?)
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2003/05/30/magpie-gzip-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MagpieRSS 0.5:  Now with GZIP support</title>
		<link>http://laughingmeme.org/2003/05/12/magpierss-05-now-with-gzip-support/</link>
		<comments>http://laughingmeme.org/2003/05/12/magpierss-05-now-with-gzip-support/#comments</comments>
		<pubDate>Tue, 13 May 2003 03:21:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[gzip]]></category>
		<category><![CDATA[magpie]]></category>
		<category><![CDATA[ted.leung]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=434</guid>
		<description><![CDATA[MagpieRSS 0.5 just hit Sourceforge. This is not the promised 0.5 with its mythical new parser, this is a much more modest release that adds support for HTTP gzip encoding to get Magpie off Bill and Ted&#8216;s bad aggregator list.(flattering to make the short list really) Also if you&#8217;re interested, a patch to Snoopy that [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://sourceforge.net/project/showfiles.php?group_id=55691&#038;release_id=158897">MagpieRSS 0.5</a> just hit Sourceforge.  This is not the promised 0.5 with its mythical new parser, this is a much more modest release that adds support for HTTP gzip encoding to get Magpie off <a href="http://www.syndic8.com/~wkearney/blogs/syndic8/">Bill</a> and <a href="http://www.sauria.com/blog">Ted</a>&#8216;s 
<a href="http://www.sauria.com/blog/2003/05/05#189">bad aggregator list</a>.(flattering to make the short list really)
</p>

<p><p>
Also if you&#8217;re interested, a patch to <a href="http://snoopy.sf.net">Snoopy</a> that gives it <a href="/snoopy_gzip.patch">gzip encoding support</a>.
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2003/05/12/magpierss-05-now-with-gzip-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gzip Encoding</title>
		<link>http://laughingmeme.org/2003/04/28/gzip-encoding/</link>
		<comments>http://laughingmeme.org/2003/04/28/gzip-encoding/#comments</comments>
		<pubDate>Tue, 29 Apr 2003 05:24:00 +0000</pubDate>
		<dc:creator>Kellan</dc:creator>
				<category><![CDATA[gzip]]></category>
		<category><![CDATA[magpie]]></category>

		<guid isPermaLink="false">http://lm.quxx.info/?p=418</guid>
		<description><![CDATA[Magpie has been &#8220;outed&#8221; for not supporting GZIP encoding. I&#8217;m thinking of switching from Snoopy to Simon&#8217;s HttpClient in order to get gzip, and a few other features. Has anyone ever played with it? Snoopy has been solid, and error free, and while development stopped on it a while ago, this is sometimes a good [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://magpierss.sf.net">Magpie</a> has been &#8220;outed&#8221; for <a href="http://www.sauria.com/blog/2003/04/26#169">not supporting GZIP encoding</a>.  I&#8217;m
thinking of switching from <a href="http://snoopy.sf.net">Snoopy</a> to 
<a href="http://scripts.incutio.com/httpclient/">Simon&#8217;s HttpClient</a> in order
to get gzip,
and a few other features.  Has anyone ever played with it?  
Snoopy has been
solid, and error free, and while development stopped on it a while ago, this is
sometimes a good thing.  HttpClient on the other hand looks to be undergoing
very active development, and I like some of the design decisions I&#8217;m seeing. 
</p>

<p><p>
One problem, is it just me, or is there no way to send arbitrary headers?(like
<code>If-None-Match</code>, to pick a purely hypothetical example)  That
would seem very strange, but quick glance threw the code seems to confirm this.
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://laughingmeme.org/2003/04/28/gzip-encoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

