[pkg-lynx-maint] Bug#1033423: lynx: Status line stuck on "HTTP/1.1 200 OK", body not rendered, no input accepted when receiving a specifically-formatted response

наб nabijaczleweli at nabijaczleweli.xyz
Fri Mar 24 19:36:26 GMT 2023


Package: lynx
Version: 2.9.0dev.6-3~deb11u1
Version: 2.9.0dev.12-1
Severity: normal

Dear Maintainer,

The ESP-IDF code for the server is:
-- >8 --
static bool gpio_state = CONFIG_ESP32PSKO_INITIAL;

#define ROOT_GET_START         \
    "<meta charset=utf-8>"     \
    "<meta name=viewport content='width=device-width, initial-scale=1'>"     \
    "<title>esp32psko</title>" \
    "<form method=post>"       \
    "<table>"                  \
    "<tr><td>Current:</td><td>"
#define ROOT_GET_PART2 \
    "</td></tr>"       \
    "<tr><td><label for=value>New:</label></td><td><input type=checkbox id=value name=value"
#define ROOT_GET_PART3                          \
    "> <input type=submit value=Set></td></tr>" \
    "</table>"                                  \
    "</form>"


static esp_err_t http_root_get_handler(httpd_req_t *req)
{
    httpd_resp_send_chunk(req, ROOT_GET_START, sizeof(ROOT_GET_START) - 1);
    httpd_resp_send_chunk(req, gpio_state ? "UP" : "DOWN", HTTPD_RESP_USE_STRLEN);
    httpd_resp_send_chunk(req, ROOT_GET_PART2, sizeof(ROOT_GET_PART2) - 1);
    if(gpio_state)
        httpd_resp_send_chunk(req, " checked", sizeof(" checked") - 1);
    httpd_resp_send_chunk(req, ROOT_GET_PART3, sizeof(ROOT_GET_PART3) - 1);
    return httpd_resp_send_chunk(req, NULL, 0);
}
-- >8 --
driven by the ESP HTTP server.

When I call this by running "lynx 192.168.1.136",
lynx shows "HTTP/1.1 200 OK" in the status line,
and the rest of the screen is black;
here's a video:
  https://lfs.nabijaczleweli.xyz/0015-cohost-images/2023-03-24-1227171-uhhhhhhh-anyone-els-2023-03-24%2019-26-20.mp4

Naturally, this isn't an ergonomic way to test this, so here are two
recorded transactions, which behave identically:
-- >8 --
$ printf '%s\r\n' 'GET / HTTP/1.1' 'Host: 192.168.1.136' '' | nc -N 192.168.1.136 80 | hd
00000000  48 54 54 50 2f 31 2e 31  20 32 30 30 20 4f 4b 0d  |HTTP/1.1 200 OK.|
00000010  0a 43 6f 6e 74 65 6e 74  2d 54 79 70 65 3a 20 74  |.Content-Type: t|
00000020  65 78 74 2f 68 74 6d 6c  0d 0a 54 72 61 6e 73 66  |ext/html..Transf|
00000030  65 72 2d 45 6e 63 6f 64  69 6e 67 3a 20 63 68 75  |er-Encoding: chu|
00000040  6e 6b 65 64 0d 0a 0d 0a  33 35 0d 0a 3c 6d 65 74  |nked....35..<met|
00000050  61 20 63 68 61 72 73 65  74 3d 75 74 66 2d 38 3e  |a charset=utf-8>|
00000060  3c 74 69 74 6c 65 3e 65  73 70 33 32 70 73 6b 6f  |<title>esp32psko|
00000070  3c 2f 74 69 74 6c 65 3e  43 75 72 72 65 6e 74 3a  |</title>Current:|
00000080  20 0d 0a 34 0d 0a 44 4f  57 4e 0d 0a 34 33 0d 0a  | ..4..DOWN..43..|
00000090  3c 62 72 20 2f 3e 3c 66  6f 72 6d 20 6d 65 74 68  |<br /><form meth|
000000a0  6f 64 3d 70 6f 73 74 3e  3c 6c 61 62 65 6c 3e 4e  |od=post><label>N|
000000b0  65 77 3a 20 3c 69 6e 70  75 74 20 74 79 70 65 3d  |ew: <input type=|
000000c0  63 68 65 63 6b 62 6f 78  20 6e 61 6d 65 3d 76 61  |checkbox name=va|
000000d0  6c 75 65 0d 0a 32 64 0d  0a 3e 3c 2f 6c 61 62 65  |lue..2d..></labe|
000000e0  6c 3e 3c 69 6e 70 75 74  20 74 79 70 65 3d 73 75  |l><input type=su|
000000f0  62 6d 69 74 20 76 61 6c  75 65 3d 53 65 74 3e 3c  |bmit value=Set><|
00000100  2f 66 6f 72 6d 3e 0d 0a  30 0d 0a 0d 0a           |/form>..0....|
0000010d

$ printf '%s\r\n' 'GET / HTTP/1.1' 'Host: 192.168.1.136' '' | nc -N 192.168.1.136 80 | hd
00000000  48 54 54 50 2f 31 2e 31  20 32 30 30 20 4f 4b 0d  |HTTP/1.1 200 OK.|
00000010  0a 43 6f 6e 74 65 6e 74  2d 54 79 70 65 3a 20 74  |.Content-Type: t|
00000020  65 78 74 2f 68 74 6d 6c  0d 0a 54 72 61 6e 73 66  |ext/html..Transf|
00000030  65 72 2d 45 6e 63 6f 64  69 6e 67 3a 20 63 68 75  |er-Encoding: chu|
00000040  6e 6b 65 64 0d 0a 0d 0a  61 30 0d 0a 3c 6d 65 74  |nked....a0..<met|
00000050  61 20 63 68 61 72 73 65  74 3d 75 74 66 2d 38 3e  |a charset=utf-8>|
00000060  3c 6d 65 74 61 20 6e 61  6d 65 3d 76 69 65 77 70  |<meta name=viewp|
00000070  6f 72 74 20 63 6f 6e 74  65 6e 74 3d 27 77 69 64  |ort content='wid|
00000080  74 68 3d 64 65 76 69 63  65 2d 77 69 64 74 68 2c  |th=device-width,|
00000090  20 69 6e 69 74 69 61 6c  2d 73 63 61 6c 65 3d 31  | initial-scale=1|
000000a0  27 3e 3c 74 69 74 6c 65  3e 65 73 70 33 32 70 73  |'><title>esp32ps|
000000b0  6b 6f 3c 2f 74 69 74 6c  65 3e 3c 66 6f 72 6d 20  |ko</title><form |
000000c0  6d 65 74 68 6f 64 3d 70  6f 73 74 3e 3c 74 61 62  |method=post><tab|
000000d0  6c 65 3e 3c 74 72 3e 3c  74 64 3e 43 75 72 72 65  |le><tr><td>Curre|
000000e0  6e 74 3a 3c 2f 74 64 3e  3c 74 64 3e 0d 0a 34 0d  |nt:</td><td>..4.|
000000f0  0a 44 4f 57 4e 0d 0a 36  30 0d 0a 3c 2f 74 64 3e  |.DOWN..60..</td>|
00000100  3c 2f 74 72 3e 3c 74 72  3e 3c 74 64 3e 3c 6c 61  |</tr><tr><td><la|
00000110  62 65 6c 20 66 6f 72 3d  76 61 6c 75 65 3e 4e 65  |bel for=value>Ne|
00000120  77 3a 3c 2f 6c 61 62 65  6c 3e 3c 2f 74 64 3e 3c  |w:</label></td><|
00000130  74 64 3e 3c 69 6e 70 75  74 20 74 79 70 65 3d 63  |td><input type=c|
00000140  68 65 63 6b 62 6f 78 20  69 64 3d 76 61 6c 75 65  |heckbox id=value|
00000150  20 6e 61 6d 65 3d 76 61  6c 75 65 0d 0a 33 38 0d  | name=value..38.|
00000160  0a 3e 20 3c 69 6e 70 75  74 20 74 79 70 65 3d 73  |.> <input type=s|
00000170  75 62 6d 69 74 20 76 61  6c 75 65 3d 53 65 74 3e  |ubmit value=Set>|
00000180  3c 2f 74 64 3e 3c 2f 74  72 3e 3c 2f 74 61 62 6c  |</td></tr></tabl|
00000190  65 3e 3c 2f 66 6f 72 6d  3e 0d 0a 30 0d 0a 0d 0a  |e></form>..0....|
000001a0
-- >8 --

I get the same thing when I run
  echo 485454502F312E3120323030204F4B0D0A436F6E74656E742D547970653A20746578742F68746D6C0D0A5472616E736665722D456E636F64696E673A206368756E6B65640D0A0D0A33350D0A3C6D65746120636861727365743D7574662D383E3C7469746C653E657370333270736B6F3C2F7469746C653E43757272656E743A200D0A340D0A444F574E0D0A34330D0A3C6272202F3E3C666F726D206D6574686F643D706F73743E3C6C6162656C3E4E65773A203C696E70757420747970653D636865636B626F78206E616D653D76616C75650D0A32640D0A3E3C2F6C6162656C3E3C696E70757420747970653D7375626D69742076616C75653D5365743E3C2F666F726D3E0D0A300D0A0D0A | base16 -d | nc -lp 8000
and open localhost:8000, for a cheaper repro.

Best,
наб

-- System Information:
Debian Release: 11.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-20-amd64 (SMP w/24 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages lynx depends on:
ii  libbsd0       0.11.3-1
ii  libbz2-1.0    1.0.8-4
ii  libc6         2.31-13+deb11u5
ii  libgnutls30   3.7.1-5+deb11u3
ii  libidn11      1.33-3
ii  libncursesw6  6.2+20201114-2
ii  libtinfo6     6.2+20201114-2
ii  lynx-common   2.9.0dev.6-3~deb11u1
ii  zlib1g        1:1.2.11.dfsg-2+deb11u2

Versions of packages lynx recommends:
ii  mime-support  3.66

lynx suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-lynx-maint/attachments/20230324/f3908e4b/attachment.sig>


More information about the pkg-lynx-maint mailing list