Re: An error with temporary file

Bela Lubkin <[email protected]>
Newsgroups gmane.comp.web.lynx.devel
Message-ID <[email protected]>
Riku Virtanen wrote:

> Data transfer complete
> /usr/bin/brotli -j -d /tmp/lynxXXXX6fQBBD/L1617-7134TMP.html.br
> Alert!: Error uncompressing temporary file!

I tried to reproduce this.  Had to custom-build Lynx with `./configure
--without-brotli`, otherwise it used library code rather than the
external utility.  With the custom build, it did use the external
utility (so '--without-brotli' really means '--without-brotli-lib').

And then `lynx -trace https://www.tripadvisor.comm` just worked.  The
external utility successfully decoded the file.  It was clear in my
trace that Lynx & tripadvisor *did* decide Brotli was the best format to
exchange, and Lynx *did* invoke the external utility, and it succeeded.

Lynx is partly at fault in your situation, for emitting a cruddy error
message like 'Alert!: Error uncompressing temporary file!'.  This
message should be much more specific: did exec() fail?  (If so, with
what errno?)  Did it work but the exec'd program exited with an error
code?  Error message?  Empty output?  Undecipherable output?  I'm sure
it has a narrower meaning we could deduce from the Lynx source, but we
shouldn't have to; certainly the *next* person with this problem
shouldn't have to...

Anyway.  You can make a fake-brotli to save the file:

=====cut=====
#!/bin/sh

case $3 in *.br)
    cp -p $3 $3.save;;
esac
exec /usr/bin/brotli "$@"
=====cut=====

Add:

    BROTLI_PATH:/path/to/fake/brotli

to your lynx.cfg, then run `lynx -trace https://www.tripadvisor.com/`
again.  Thus collecting a copy of whatever.br as was received by Lynx.

Confirm in the trace output that it actually ran your fake-brotli; then
go look for $3.save -- is it a valid Brotli format file?  Is it empty?
Is it an uncompressed HTML file which is spuriously being served to your
browser as Brotli-compressed?

[ Don't forget to remove BROTLI_PATH from lynx.cfg.  BTW, is there a
Lynx flag like '--cfg_line=BROTLI_PATH:/path/to/fake/brotli'? ]

>Bela<
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.