FGasper/zmodemjs

Uncaught RangeError: Maximum call stack size exceeded

tsl0922 opened this issue · 3 comments

I'm debugging my server side C code, this happens when I changed the server code to send all the buffered data at once.

Uncaught RangeError: Maximum call stack size exceeded
    at ZmodemReceiveSession._strip_and_enqueue_input ((index):9501)
    at ZmodemReceiveSession.consume ((index):9292)
    at ZmodemSentry.consume ((index):8900)
    at WebSocket.ws.onmessage ((index):339)

Chrome Network Tab shows the maximum websocket message size is 327751.

Changed the buffer size to 32K, it works fine now.

Zmodem (the protocol) specifies 1 KiB packet size. The classic lrzsz tool supports up to 8, so that’s what zmodem.js sends.

Just for curiosity, why are you writing new C code for Zmodem? Does none of the existing libraries suffice?

I'm changing ttyd's code (C, not zmodem 😄 ) to support zmodem on the browser (with zmodemjs).

It's initially done now, may be lack of some error handling. You may wan't to try it:

https://github.com/tsl0922/ttyd/commits/dev