Thomas Dickey wrote:
>Also, steps to reproduce the problem.

OK, can provide that straight away.  For this recipe, there should be
no ~/.lynxrc in place.  First, at the command line:

$ echo '<p><a href="https://en.wikipedia.org/wiki/Main_Page";>Wikipedia</a></p>' 
>x0.html
$ lynx -cookies x0.html

Lynx fires up, displaying the rendered x0.html page, containing only
the single "Wikipedia" hyperlink.  Press <return>.  In response Lynx
displays the Wikipedia front page.  Press "u".  In response Lynx returns
to displaying the rendered x0.html page.  Press <return>.  At this point,
correct behaviour would be to display the Wikipedia front page.  Observed
incorrect behaviour is that there is some brief status line activity
but when it's over the rendered x0.html page continues to be displayed.

The state of the -cookies option doesn't affect the bug; using the
option in the above recipe just simplifies the interaction.  Likewise,
~/.lynxrc configuration is irrelevant as far as I've explored; having
no such config file is just a conveniently-reproducible reference point.

Varying the link target shows correct behaviour for some websites and
incorrect for others.  For example, correct behaviour is observed if
the link is to <https://encrypted.google.com>.

strace can show some of what's going on.  The first time the link is
selected, Lynx forks off a short-lived process that apparently handles the
DNS lookup, then opens an IPv6/TCP connection to en.wikipedia.org:443
and performs some network I/O, with commentary in the status line.
After commenting "HTTP/1.1 200 OK" it opens a temporary .html.gz file, and
from there on while continuing to read from the network it writes to the
temporary file.  It closes the network connection and the temporary file.
It then reopens the file read-only, reads part of it, and closes it again.
It then reopens the file read-only again, reads all of it while rendering
to the screen, and then closes the file again.

Upon "u", Lynx changes the display back to the rendered x0.html page
without any network or file action.

The second time the link is selected, Lynx initially proceeds as it
did the first time: short-lived DNS process, open IPv6/TCP connection,
network I/O with status-line commentary up to "HTTP/1.1 200 OK".
But it does not open any temporary file.  It reads the bulk of the
network response without strace showing any evidence of where the
data is going.  It comments "Data transfer complete" (as it did at
this point the first time), but then immediately comments "Getting
file://localhost/[...]/x0.html".  Without actually referring to any file,
it rewrites the display of the rendered x0.html file, and then rewrites
the status line back to its normal state.  It then rewrites the rendered
display again with different colouration, and finally waits for input.

-zefram

Reply via email to