mirror of
https://github.com/danbulant/node-x11
synced 2026-06-12 11:10:31 +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)
|
||||
{
|
||||
delete display.screen_num;
|
||||
cbDisplayReady(display);
|
||||
cbDisplayReady(null, display);
|
||||
return;
|
||||
} else {
|
||||
readScreens(bl, display, cbDisplayReady);
|
||||
|
|
|
|||
|
|
@ -531,10 +531,12 @@ XClient.prototype.startHandshake = function() {
|
|||
var client = this;
|
||||
|
||||
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
|
||||
// emit error in that case
|
||||
if (err) {
|
||||
client.emit('error', err);
|
||||
return;
|
||||
}
|
||||
client.expectReplyHeader();
|
||||
client.display = display;
|
||||
display.client = client;
|
||||
|
|
|
|||
Loading…
Reference in a new issue