sidorares/node-x11

Small unpacking typos in the handshake

chrisdone opened this issue ยท 1 comments

In handshake.js L85 there is this benign issue:

bl.unpackTo( scr,
[
// [snip]
   'S max_installed_maps',
   'L root_visual',
   'C root_depth',  
    // ^^^^ this should not be here: the next thing after root_visual should be backing_stores
   'C backing_stores',
   'C root_depth', /// <-- root depth is duplicated here, and no save_unders is considered
   'C num_depths'
],
function () {
    var depths = {};

From the X11 protocol spec, it should be:

screenshot 2018-04-08 19 43 10

So:

  • your first root_depth should be dropped โœ‚๏ธ
  • your second root_depth is fine ๐Ÿ‘
  • and it should be followed by save_unders ๐Ÿ†•

I'm currently implementing a teeny X11 server and I'm using your client to test it and insert debug statements. I was comparing your "unpack" to my "pack" to see if they line up and just happened to notice this discrepancy! ๐Ÿ˜„

I think it doesn't actually cause a bug or anything because the values coincidentally line up or aren't used. I'll let you know if I find anything else.

Hi! Thanks for this @chrisdone !
Can you submit PR so the change goes under your name?