sidorares / node-x11

X11 node.js network protocol client
MIT License
518 stars 72 forks source link

Small unpacking typos in the handshake #168

Closed chrisdone closed 6 years ago

chrisdone commented 6 years ago

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:

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.

sidorares commented 6 years ago

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