Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

turn around if parameters

  • Loading branch information...
commit 0423bc864e0346500dfe2cc04ac5fd0ca3a9bfa5 1 parent 89d22fa
@nicokaiser nicokaiser authored
View
8 lib/protocols/drafts.js
@@ -138,7 +138,7 @@ WebSocket.prototype.onOpen = function () {
this.socket.setEncoding('binary');
} else if (this.proveReception(headers)) {
process.nextTick(function() {
- if (self.readyState == 'opening') {
+ if ('opening' == self.readyState) {
self.readyState = 'open';
self.emit('open');
self.flush();
@@ -166,7 +166,7 @@ WebSocket.prototype.onOpen = function () {
if (self.proveReception(headers)) {
process.nextTick(function() {
- if (self.readyState == 'opening') {
+ if ('opening' == self.readyState) {
self.readyState = 'open';
self.emit('open');
self.flush();
@@ -188,7 +188,7 @@ WebSocket.prototype.onOpen = function () {
*/
WebSocket.prototype.write = function (data) {
- if (this.readyState == 'open' && this.socket.readyState == 'open') {
+ if ('open' == this.readyState && 'open' == this.socket.readyState) {
this.drained = false;
if (this.buffer) {
@@ -264,7 +264,7 @@ WebSocket.prototype.proveReception = function (headers) {
md5.update(this.req.head.toString('binary'));
- if (this.socket.readyState != 'open') {
+ if ('open' != this.socket.readyState) {
this.end();
return false;
}
View
4 lib/protocols/hybi.js
@@ -82,7 +82,7 @@ WebSocket.prototype.onOpen = function () {
});
process.nextTick(function() {
- if (self.readyState == 'opening') {
+ if ('opening' == self.readyState) {
self.readyState = 'open';
self.emit('open');
}
@@ -97,7 +97,7 @@ WebSocket.prototype.onOpen = function () {
*/
WebSocket.prototype.write = function (data) {
- if (this.readyState == 'open' && this.ws) {
+ if ('open' == this.readyState && this.ws) {
this.ws.send(data);
debug(this.name + ' writing', data);
}
View
6 lib/socket.js
@@ -72,7 +72,7 @@ Socket.prototype.socket;
*/
Socket.prototype.onClose = function () {
- if (this.readyState != 'closed') {
+ if ('closed' != this.readyState) {
this.socket.destroy();
this.readyState = 'closed';
this.emit('close');
@@ -113,7 +113,7 @@ Socket.prototype.send = function (data) {
*/
Socket.prototype.close = Socket.prototype.end = function () {
- if (this.readyState == 'open') {
+ if ('open' == this.readyState) {
this.socket.end();
var self = this;
process.nextTick(function () {
@@ -133,7 +133,7 @@ Socket.prototype.close = Socket.prototype.end = function () {
*/
Socket.prototype.destroy = function () {
- if (this.readyState != 'closed') {
+ if ('closed' != this.readyState) {
this.socket.destroy();
this.onClose();
}

0 comments on commit 0423bc8

Please sign in to comment.
Something went wrong with that request. Please try again.