jsoftware / jsource

J engine source mirror
Other
657 stars 90 forks source link

bug in jqt websocket handling of '*' strings #187

Closed tangentstorm closed 6 months ago

tangentstorm commented 6 months ago

The docs for the window driver command syntax [1] say that * can be followed by an arbitrary binary string, but something in the jqt websocket driver seems to truncate the string if the following sequence is found in any order, with any number of characters in between:

Example session:

   wssvr_handler_z_ =: {{ 'e sock' =: y }}
   wd 'ws listen 5555'

   wscln_handler_z_ =: ]
   client=: wd 'ws connect ws://localhost:5555'

   NB. send the string. return its actual length and the number of bytes sent
   test =: #;{{wd 'ws send ',client,' *',y}}

   test 'abcd'
┌─┬─┐
│4│4│
└─┴─┘

   test 'a"b"c;d'
┌─┬─┐
│7│5│
└─┴─┘

   test '"";'   NB. simplest case
┌─┬─┐
│3│2│
└─┴─┘

The following demonstrates that the wd driver itself is able to parse the sequence correctly (the full string shows up, including the semicolon), so the problem must be in the websocket handling.

wd'pc abc closeok;minwh 150 100;cc e edit;pshow;set e text *"";'

[1] https://code.jsoftware.com/wiki/Guides/Window_Driver/Command_Syntax

cdburke commented 6 months ago

Thanks for reporting it. The websocket connection should accept binary data. I'll take a look.

BTW, this repo is for the J engine. The qtide repo would be better for this issue, but I will reply privately.

tangentstorm commented 6 months ago

Thanks so much! Sorry for posting it in the wrong place :)