mattinsler/longjohn

Issues with gunzip

Closed this issue · 3 comments

Hello,

At work we are using longjohn together with our own async library, which works wonders,
only recently we began parsing gzipped files.

The issue is that when using longjohn that the gunzip of the zlib core module virtually stops responding.
We have tested and it responds after a few hours.

I will include the code that will give this issue:

var zlib = require('zlib'),
    request = require('request'),
    longjohn = require('longjohn');

request({ url: 'http://www.jaap.nl/sitemaps/sitemap1.xml.gz', encoding: null }, function(error, response, body) {
  if(response.statusCode === 200) {
    zlib.gunzip(body, function (err, data) {
      console.log(data); // This callback is never executed.
    });
  }
});

When removing the require of longjohn the callback is called without any issue.

I hope this issue can be fixed.

Kind regards and Thanks in advance,

Jasper van Rijbroek

Hi. Try this #48.

@drauggres I have tried your code and it indeed seems to fix the issues.

Thanks for you fast response :)

Kind Regards,

Jasper van Rijbroek

@JaspervRijbroek @drauggres You can now update to version 0.2.8 which is the code from #48.