lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lynx-dev] alert: could not open file for decompression!


From: Ian Collier
Subject: Re: [Lynx-dev] alert: could not open file for decompression!
Date: Thu, 30 Jan 2020 11:47:41 +0000

russellbell wrote:
>         I get this when I try to access pnm.com (my electrical
> utility).  It seems to be a gzip error.  The file in
> /tmp/lynxXXXXrJ5hup/ is indeed not gzip.  Is this PNM's fault?

It appears to me that what is happening is that pnm is sending
back headers which include these two lines:

Transfer-Encoding: chunked
Content-Encoding: gzip

However, the data it sends back following the headers is not in fact
chunked.  [0] explains that if these headers are used together then
it should be compressed first, then chunked; so the first thing you
receive should be the chunk length.  Instead PNM just sends the 
compressed data.

So Lynx reads up to the first linefeed expecting to find the length
value.  It doesn't find it, so reverts to non-chunked mode and writes
the rest of the data to the temporary file.  However, it doesn't write
the bytes that were already read; so the temporary file lacks the
magic number that defines the compression used, and it can't be
decompressed.

Therefore this is the PNM server's fault, but maybe Lynx could
recover a bit better than it does.

The answer is to go to Options and set "Preferred encoding" to None.

imc

[0] https://en.wikipedia.org/wiki/Chunked_transfer_encoding#Use_with_compression




reply via email to

[Prev in Thread] Current Thread [Next in Thread]