On Mon, Mar 27, 2023 at 07:20:25PM -0400, Thomas Dickey wrote: > On Fri, Mar 24, 2023 at 08:36:26PM +0100, наб wrote: > > Package: lynx > > Version: 2.9.0dev.6-3~deb11u1 > > Version: 2.9.0dev.12-1 > > Severity: normal > ... > > I get the same thing when I run > > echo > > 485454502F312E3120323030204F4B0D0A436F6E74656E742D547970653A20746578742F68746D6C0D0A5472616E736665722D456E636F64696E673A206368756E6B65640D0A0D0A33350D0A3C6D65746120636861727365743D7574662D383E3C7469746C653E657370333270736B6F3C2F7469746C653E43757272656E743A200D0A340D0A444F574E0D0A34330D0A3C6272202F3E3C666F726D206D6574686F643D706F73743E3C6C6162656C3E4E65773A203C696E70757420747970653D636865636B626F78206E616D653D76616C75650D0A32640D0A3E3C2F6C6162656C3E3C696E70757420747970653D7375626D69742076616C75653D5365743E3C2F666F726D3E0D0A300D0A0D0A > > | base16 -d | nc -lp 8000 > > and open localhost:8000, for a cheaper repro. > > thanks - I can reproduce this case (trace shows it reads the whole file)
The basic problem is that using nc in this way differs from a real webserver, because it leaves the connection open and inactive. Lynx actually will time out in that case, but it is a long time by default, to provide for slow connections. man lynx: -read_timeout=N Sets the read-timeout, where N is given in seconds. lynx.cfg: .h2 READ_TIMEOUT # Specifies (in seconds) read-timeout. Default value is rather huge. #READ_TIMEOUT:18000 (30 minutes). Some other programs (not all) work around this by either using multiple threads (and providing for partial updates), or polling for activity (for the same purpose). Lynx does neither. As an alternative, one can interrupt the read, e.g., using ^G. In the existing Lynx, that has the drawback that the connection is abandoned (which is a problem if you run it to just connect to a certain page -- Lynx exits). To work around that problem, I modified the behavior to gracefully close (no exit) if you interrupt the read loop. That keeps ^G in its existing behavior for interrupting connection attempts, and makes this example work as intended. The workaround is in Lynx 2.9.0 -- Thomas E. Dickey <dic...@invisible-island.net> https://invisible-island.net
signature.asc
Description: PGP signature