Closed lonnywong closed 12 months ago
@tsl0922
If add --ping-interval 1
, trz
is much faster, but it still keeps pausing for one second.
ttyd --writable -P 1 -t enableTrzsz=true bash
When the issue occurs, the behavior is as follows:
trz
prints some output.process_read_cb
calls lws_callback_on_writable
( no delay ):
https://github.com/tsl0922/ttyd/blob/272f2f8de150454fca7895913bd85c60a6c3ac2e/src/protocol.c#L92LWS_CALLBACK_SERVER_WRITEABLE
gets called ( no delay ):
https://github.com/tsl0922/ttyd/blob/272f2f8de150454fca7895913bd85c60a6c3ac2e/src/protocol.c#L253pss->pty_buf
is not null:
https://github.com/tsl0922/ttyd/blob/272f2f8de150454fca7895913bd85c60a6c3ac2e/src/protocol.c#L275lws_write
( no delay ):
https://github.com/tsl0922/ttyd/blob/272f2f8de150454fca7895913bd85c60a6c3ac2e/src/protocol.c#L176LWS_CALLBACK_SERVER_WRITEABLE
gets called again:
https://github.com/tsl0922/ttyd/blob/272f2f8de150454fca7895913bd85c60a6c3ac2e/src/protocol.c#L253pss->pty_buf
is null:
https://github.com/tsl0922/ttyd/blob/272f2f8de150454fca7895913bd85c60a6c3ac2e/src/protocol.c#L275lws_write
is not called again, but the browser client receive the message now. Don't know the client receive it before LWS_CALLBACK_SERVER_WRITEABLE
, or after it.The issue may relate to https://github.com/warmcat/libwebsockets/issues/1158 .
@tsl0922 Are there any features of ttyd that depends on -DLWS_WITHOUT_EXTENSIONS=OFF
?
https://github.com/tsl0922/ttyd/blob/5aa2da4bd36858a287224e41a14cc3e6e6a47616/scripts/cross-build.sh#L108
If you delete the line, the issue is solved. But if there are features that depends on it, we need to fix this: https://github.com/warmcat/libwebsockets/issues/1158#issuecomment-1806741778
1179
Well, we can't get around it.
Do you think it's related to data compression? I think we can add a flag for it in ttyd.
We may need a flush somewhere. https://github.com/warmcat/libwebsockets/issues/1158#issuecomment-1812446179
Describe the bug The trzsz ( trz / tsz ) is slow due to some pauses of about 5 seconds.
To Reproduce Steps to reproduce the behavior:
ttyd --writable -t enableTrzsz=true bash
F12
, clickNetwork
http://localhost:7681
trz
command, and choose some files to uploadExpected behavior No pauses while
trzsz
is transferring files, and the speed should be 1MB/s at least.Screenshots
Environment: