Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zmodem troubles in 1.5.2 #239

Closed
cdr8H opened this issue Sep 29, 2019 · 2 comments
Closed

zmodem troubles in 1.5.2 #239

cdr8H opened this issue Sep 29, 2019 · 2 comments

Comments

@cdr8H
Copy link

cdr8H commented Sep 29, 2019

when using Debian Buster sz command (0.12.21rc), the file will be received by the clients browser (Firefox as well as Chrome), but javascript throws an error:

(index):1 [ttyd] zmodem consume: PROTOCOL: Only thing after ZFIN should be “OO” (79,79), not: 99,100,114,64,115,49,58,126,36,32
handleError @ (index):1
consume @ (index):1
onSocketData @ (index):1

This behaviour occurs inconsistently - sometimes after a fresh browser start, the first zmodem receive trial is successfull, but only the first one per session.

The session hangs because a input typed will stuck here:

do{t=this._next_subpacket_handler?this._parse_and_consume_subpacket()....

@cdr8H
Copy link
Author

cdr8H commented Sep 29, 2019

follow up ....

the javascript zmodem implementation seems to see the shell prompt sent from ttypd as part of the data transfered. 99,100,114,64,115,49,58,126,36,32 = my bash prompt "cdr@s1~$ "

when setting the bash prompt (PS1) = "OO" everything is fine ;-) but that is an ugly hack.

The docs for zmodem says:

Session Cleanup The sender closes the session with a ZFIN header. The receiver acknowledges this with its own ZFIN header. When the sender receives the acknowledging header, it sends two characters, "OO" (Over and Out) and exits to the operating system or application that invoked it. The receiver waits briefly for the "O" characters, then exits whether they were received or not.

Better workaround:

#!/bin/bash

[ ! -r $1 ] || [ -z "$1" ] && exit 1

sz $1 
echo -en "OO"

@tsl0922
Copy link
Owner

tsl0922 commented Dec 7, 2019

Can't reproduce, glad that you resolves it yourself 👍 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants