mirror of
https://github.com/danbulant/node-x11
synced 2026-06-24 17:21:47 +00:00
Emit error when handshake fails, such as with bad xauth
This commit is contained in:
parent
c694394b6d
commit
a42f043768
2 changed files with 6 additions and 4 deletions
|
|
@ -90,7 +90,7 @@ function readScreens(bl, display, cbDisplayReady)
|
||||||
if (display.screen.length == display.screen_num)
|
if (display.screen.length == display.screen_num)
|
||||||
{
|
{
|
||||||
delete display.screen_num;
|
delete display.screen_num;
|
||||||
cbDisplayReady(display);
|
cbDisplayReady(null, display);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
readScreens(bl, display, cbDisplayReady);
|
readScreens(bl, display, cbDisplayReady);
|
||||||
|
|
|
||||||
|
|
@ -531,10 +531,12 @@ XClient.prototype.startHandshake = function() {
|
||||||
var client = this;
|
var client = this;
|
||||||
|
|
||||||
handshake.writeClientHello(this.pack_stream, this.displayNum, this.authHost, this.authFamily);
|
handshake.writeClientHello(this.pack_stream, this.displayNum, this.authHost, this.authFamily);
|
||||||
handshake.readServerHello(this.pack_stream, function(display)
|
handshake.readServerHello(this.pack_stream, function(err, display)
|
||||||
{
|
{
|
||||||
// TODO: readServerHello can set error state in display
|
if (err) {
|
||||||
// emit error in that case
|
client.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
client.expectReplyHeader();
|
client.expectReplyHeader();
|
||||||
client.display = display;
|
client.display = display;
|
||||||
display.client = client;
|
display.client = client;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue