Skip to content

Commit

Permalink
Save flushed and return value. Say 'false' where there's an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydwatkin committed May 18, 2013
1 parent b79f07b commit ce97c24
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/xmpp/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,19 @@ Connection.prototype.send = function(stanza) {
}

if (stanza.root) {
var el = this.rmXmlns(stanza.root());
var el = this.rmXmlns(stanza.root())
this.socket.serializeStanza(el, function(s) {
if (self.socket.writable) {
self.socket.write(s);
flushed = self.socket.write(s)
} else {
self.error('internal-server-error', 'socket not writable');
self.error('internal-server-error', 'socket not writable')
flushed = false
}
});
} else {
flushed = this.socket.write(stanza);
flushed = this.socket.write(stanza)
}
return flushed;
return flushed
};

Connection.prototype.startParser = function() {
Expand Down

0 comments on commit ce97c24

Please sign in to comment.