Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class Client extends Socket {
}

/*
* Send a message to the server. This method returns a Writable stream object
* Send a message to the server. This method returns a Writable stream object
* for sending the frame body content.
*/
send(headers, options) {
Expand Down Expand Up @@ -215,7 +215,7 @@ class Client extends Socket {
headers = {destination: headers};
}

let id = headers.id !== undefined ?
let id = headers.id !== undefined ?
headers.id : this._nextSubcriptionId++;

while (this._subscriptions[id] !== undefined) {
Expand Down Expand Up @@ -328,7 +328,7 @@ class Client extends Socket {
}
}).end(this._finishOutput.bind(this));

// Keep the transport output open until the receipt is processed just in
// Keep the transport output open until the receipt is processed just in
// case the transport is not configured to handle half-open connections.

this._disconnecting = true;
Expand Down Expand Up @@ -432,9 +432,11 @@ function onError(frame) {

const content = new BufferWritable(Buffer.alloc(ERROR_MAX_CONTENT_LENGTH));

const self = this;

frame.on('end', function() {
error.longMessage = content.getWrittenSlice().toString();
this.destroy(error);
self.destroy(error);
});

frame.pipe(content);
Expand Down