Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Check if socket is writable before writing to it… #75

Closed
wants to merge 2 commits into from

2 participants

@sbstjn

No description provided.

semu added some commits
@lloydwatkin
Owner

Shouldn't we still save the value of 'flushed' so it can be returned later in the method?

@lloydwatkin
Owner

Merged, with slight edit at ce97c24. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 25, 2012
  1. Update master

    semu authored
  2. Update master

    semu authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/xmpp/connection.js
View
6 lib/xmpp/connection.js
@@ -124,7 +124,11 @@ Connection.prototype.send = function(stanza) {
if (stanza.root) {
var el = this.rmXmlns(stanza.root());
this.socket.serializeStanza(el, function(s) {
- flushed = self.socket.write(s);
+ if (self.socket.writable) {
+ self.socket.write(s);
+ } else {
+ self.error('internal-server-error', 'socket not writable');
+ }
});
} else {
flushed = this.socket.write(stanza);
Something went wrong with that request. Please try again.