[git commit] telnet: rewrite to use ioloop()

Denys Vlasenko vda.linux at googlemail.com
Mon Feb 23 13:47:17 UTC 2026


commit: https://git.busybox.net/busybox/commit/?id=87fcfe7dfedfbc6925c164e8404c03dc02921264
branch: https://git.busybox.net/busybox/log/?h=master

Now should never block on network I/O. Also, window resizing is dynamic now.

function                                             old     new   delta
write_to_net                                           -     596    +596
read_from_net                                          -     543    +543
read_from_stdin                                        -     227    +227
show_menu                                              -     212    +212
write_to_stdout                                        -     105    +105
have_data_to_write_to_net                              -      72     +72
have_data_to_write_to_stdout                           -      38     +38
put_iac_byte_escaped                                   -      32     +32
ioloop_run                                           411     438     +27
have_buffer_to_read_from_stdin                         -      25     +25
have_buffer_to_read_from_net                           -      25     +25
.rodata                                           107125  107141     +16
handle_SIGWINCH                                        -      15     +15
put_iac                                               36      28      -8
put_iac4_msb_lsb                                      19       -     -19
iac_flush                                             36       -     -36
setConMode                                            87       -     -87
handle_net_output                                    110       -    -110
con_escape                                           271       -    -271
telnet_main                                         1232     476    -756
------------------------------------------------------------------------------
(add/remove: 11/5 grow/shrink: 2/2 up/down: 1933/-1287)       Total: 646 bytes

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 include/libbb.h                       |    4 +-
 libbb/ioloop.c                        |    2 +
 networking/telnet.c                   | 1125 ++++++++++++++++++++-------------
 networking/{telnet.c => telnet.c.OLD} |    0
 4 files changed, 691 insertions(+), 440 deletions(-)

Patch is too large, so refusing to show it


More information about the busybox-cvs mailing list