Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uptime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tools
uptime
Commits
3adab634
Commit
3adab634
authored
8 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
#4
Update socket.io
parent
9a36ee82
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package.json
+1
-1
1 addition, 1 deletion
package.json
patches/01.socketio.eventemitter.patch
+511
-0
511 additions, 0 deletions
patches/01.socketio.eventemitter.patch
with
512 additions
and
1 deletion
package.json
+
1
−
1
View file @
3adab634
...
...
@@ -12,7 +12,7 @@
"
ejs
"
:
"
0.8.3
"
,
"
config
"
:
"
0.4.32
"
,
"
async
"
:
"
0.1.22
"
,
"
socket.io
"
:
"
0.9.1
4
"
,
"
socket.io
"
:
"
0.9.1
7
"
,
"
semver
"
:
"
1.1.0
"
,
"
moment
"
:
"
2.1.0
"
,
"
nodemailer
"
:
"
0.3.35
"
,
...
...
This diff is collapsed.
Click to expand it.
patches/01.socketio.eventemitter.patch
0 → 100644
+
511
−
0
View file @
3adab634
Index: node_modules/socket.io/lib/store.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- node_modules/socket.io/lib/store.js (revision )
+++ node_modules/socket.io/lib/store.js (revision )
@@ -15,7 +15,7 @@
* Module dependencies.
*/
-var EventEmitter = process.EventEmitter;
+var EventEmitter = require('events').EventEmitter;
/**
* Store interface
Index: node_modules/socket.io/lib/manager.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- node_modules/socket.io/lib/manager.js (revision )
+++ node_modules/socket.io/lib/manager.js (revision )
@@ -21,7 +21,7 @@
, MemoryStore = require('./stores/memory')
, SocketNamespace = require('./namespace')
, Static = require('./static')
- , EventEmitter = process.EventEmitter;
+ , EventEmitter = require('events').EventEmitter;
/**
* Export the constructor.
@@ -146,7 +146,7 @@
});
this.sequenceNumber = Date.now() | 0;
-
+
this.log.info('socket.io started');
};
Index: node_modules/socket.io/lib/transports/websocket/default.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- node_modules/socket.io/lib/transports/websocket/default.js (revision )
+++ node_modules/socket.io/lib/transports/websocket/default.js (revision )
@@ -9,7 +9,7 @@
*/
var Transport = require('../../transport')
- , EventEmitter = process.EventEmitter
+ , EventEmitter = require('events').EventEmitter
, crypto = require('crypto')
, parser = require('../../parser');
Index: node_modules/socket.io/lib/transports/websocket/hybi-16.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- node_modules/socket.io/lib/transports/websocket/hybi-16.js (revision )
+++ node_modules/socket.io/lib/transports/websocket/hybi-16.js (revision )
@@ -3,13 +3,13 @@
* Copyright(c) 2011 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
-
+
/**
* Module requirements.
*/
var Transport = require('../../transport')
- , EventEmitter = process.EventEmitter
+ , EventEmitter = require('events').EventEmitter
, crypto = require('crypto')
, url = require('url')
, parser = require('../../parser')
@@ -95,7 +95,7 @@
WebSocket.prototype.onSocketConnect = function () {
var self = this;
- if (typeof this.req.headers.upgrade === 'undefined' ||
+ if (typeof this.req.headers.upgrade === 'undefined' ||
this.req.headers.upgrade.toLowerCase() !== 'websocket') {
this.log.warn(this.name + ' connection invalid');
this.end();
@@ -107,23 +107,23 @@
origin.match(/^https/) : this.socket.encrypted) ?
'wss' : 'ws')
+ '://' + this.req.headers.host + this.req.url;
-
+
if (!this.verifyOrigin(origin)) {
this.log.warn(this.name + ' connection invalid: origin mismatch');
this.end();
- return;
+ return;
}
-
+
if (!this.req.headers['sec-websocket-key']) {
this.log.warn(this.name + ' connection invalid: received no key');
this.end();
return;
}
-
+
// calc key
- var key = this.req.headers['sec-websocket-key'];
- var shasum = crypto.createHash('sha1');
- shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
+ var key = this.req.headers['sec-websocket-key'];
+ var shasum = crypto.createHash('sha1');
+ shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
key = shasum.digest('base64');
var headers = [
@@ -177,7 +177,7 @@
}
}
else {
- this.log.warn('origin missing from websocket call, yet required by config');
+ this.log.warn('origin missing from websocket call, yet required by config');
}
return false;
};
@@ -269,7 +269,7 @@
*
* @api public
*/
-
+
function Parser (opts) {
this.state = {
activeFragmentedOperation: null,
@@ -285,7 +285,7 @@
this._maxBuffer = (opts && opts.maxBuffer) || 10E7;
this._dataLength = 0;
- var self = this;
+ var self = this;
this.opcodeHandlers = {
// text
'1': function(data) {
@@ -308,10 +308,10 @@
});
}
else {
- self.expect('Data', length, function(data) {
+ self.expect('Data', length, function(data) {
finish(null, data);
});
- }
+ }
}
// decode length
@@ -333,7 +333,7 @@
var lengthBytes = data.slice(4); // note: cap to 32 bit length
expectData(util.unpack(data));
});
- }
+ }
},
// binary
'2': function(data) {
@@ -357,10 +357,10 @@
});
}
else {
- self.expect('Data', length, function(data) {
+ self.expect('Data', length, function(data) {
finish(null, data);
});
- }
+ }
}
// decode length
@@ -382,7 +382,7 @@
var lengthBytes = data.slice(4); // note: cap to 32 bit length
expectData(util.unpack(data));
});
- }
+ }
},
// close
'8': function(data) {
@@ -395,7 +395,7 @@
self.error('fragmented ping is not supported');
return;
}
-
+
var finish = function(mask, data) {
self.emit('ping', self.unmask(mask, data));
self.endPacket();
@@ -411,16 +411,16 @@
});
}
else {
- self.expect('Data', length, function(data) {
+ self.expect('Data', length, function(data) {
finish(null, data);
});
- }
+ }
}
// decode length
var firstLength = data[1] & 0x7f;
if (firstLength == 0) {
- finish(null, null);
+ finish(null, null);
}
else if (firstLength < 126) {
expectData(firstLength);
@@ -434,11 +434,11 @@
self.expect('Length', 8, function(data) {
expectData(util.unpack(data));
});
- }
+ }
}
}
- this.expect('Opcode', 2, this.processPacket);
+ this.expect('Opcode', 2, this.processPacket);
};
/**
@@ -496,7 +496,7 @@
this.overflow = new Buffer(this.overflow.length + data.length);
prevOverflow.copy(this.overflow, 0);
data.copy(this.overflow, prevOverflow.length);
- }
+ }
}
/**
@@ -530,11 +530,11 @@
if ((data[0] & 0x70) != 0) {
this.error('reserved fields must be empty');
return;
- }
- this.state.lastFragment = (data[0] & 0x80) == 0x80;
+ }
+ this.state.lastFragment = (data[0] & 0x80) == 0x80;
this.state.masked = (data[1] & 0x80) == 0x80;
var opcode = data[0] & 0xf;
- if (opcode == 0) {
+ if (opcode == 0) {
// continuation frame
this.state.opcode = this.state.activeFragmentedOperation;
if (!(this.state.opcode == 1 || this.state.opcode == 2)) {
@@ -542,7 +542,7 @@
return;
}
}
- else {
+ else {
this.state.opcode = opcode;
if (this.state.lastFragment === false) {
this.state.activeFragmentedOperation = opcode;
@@ -570,7 +570,7 @@
this.state.lastFragment = false;
this.state.opcode = this.state.activeFragmentedOperation != null ? this.state.activeFragmentedOperation : 0;
this.state.masked = false;
- this.expect('Opcode', 2, this.processPacket);
+ this.expect('Opcode', 2, this.processPacket);
}
/**
@@ -603,7 +603,7 @@
if (mask != null) {
for (var i = 0, ll = buf.length; i < ll; i++) {
buf[i] ^= mask[i % 4];
- }
+ }
}
if (binary) return buf;
return buf != null ? buf.toString('utf8') : '';
Index: node_modules/socket.io/lib/transports/websocket/hybi-07-12.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- node_modules/socket.io/lib/transports/websocket/hybi-07-12.js (revision )
+++ node_modules/socket.io/lib/transports/websocket/hybi-07-12.js (revision )
@@ -4,13 +4,13 @@
* Copyright(c) 2011 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
-
+
/**
* Module requirements.
*/
var Transport = require('../../transport')
- , EventEmitter = process.EventEmitter
+ , EventEmitter = require('events').EventEmitter
, crypto = require('crypto')
, url = require('url')
, parser = require('../../parser')
@@ -96,7 +96,7 @@
WebSocket.prototype.onSocketConnect = function () {
var self = this;
- if (typeof this.req.headers.upgrade === 'undefined' ||
+ if (typeof this.req.headers.upgrade === 'undefined' ||
this.req.headers.upgrade.toLowerCase() !== 'websocket') {
this.log.warn(this.name + ' connection invalid');
this.end();
@@ -108,23 +108,23 @@
origin.match(/^https/) : this.socket.encrypted) ?
'wss' : 'ws')
+ '://' + this.req.headers.host + this.req.url;
-
+
if (!this.verifyOrigin(origin)) {
this.log.warn(this.name + ' connection invalid: origin mismatch');
this.end();
- return;
+ return;
}
-
+
if (!this.req.headers['sec-websocket-key']) {
this.log.warn(this.name + ' connection invalid: received no key');
this.end();
return;
}
-
+
// calc key
- var key = this.req.headers['sec-websocket-key'];
- var shasum = crypto.createHash('sha1');
- shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
+ var key = this.req.headers['sec-websocket-key'];
+ var shasum = crypto.createHash('sha1');
+ shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
key = shasum.digest('base64');
var headers = [
@@ -178,7 +178,7 @@
}
}
else {
- this.log.warn('origin missing from websocket call, yet required by config');
+ this.log.warn('origin missing from websocket call, yet required by config');
}
return false;
};
@@ -270,7 +270,7 @@
*
* @api public
*/
-
+
function Parser (opts) {
this.state = {
activeFragmentedOperation: null,
@@ -286,7 +286,7 @@
this._maxBuffer = (opts && opts.maxBuffer) || 10E7;
this._dataLength = 0;
- var self = this;
+ var self = this;
this.opcodeHandlers = {
// text
'1': function(data) {
@@ -309,10 +309,10 @@
});
}
else {
- self.expect('Data', length, function(data) {
+ self.expect('Data', length, function(data) {
finish(null, data);
});
- }
+ }
}
// decode length
@@ -334,7 +334,7 @@
var lengthBytes = data.slice(4); // note: cap to 32 bit length
expectData(util.unpack(data));
});
- }
+ }
},
// binary
'2': function(data) {
@@ -358,10 +358,10 @@
});
}
else {
- self.expect('Data', length, function(data) {
+ self.expect('Data', length, function(data) {
finish(null, data);
});
- }
+ }
}
// decode length
@@ -383,7 +383,7 @@
var lengthBytes = data.slice(4); // note: cap to 32 bit length
expectData(util.unpack(data));
});
- }
+ }
},
// close
'8': function(data) {
@@ -396,7 +396,7 @@
self.error('fragmented ping is not supported');
return;
}
-
+
var finish = function(mask, data) {
self.emit('ping', self.unmask(mask, data));
self.endPacket();
@@ -412,16 +412,16 @@
});
}
else {
- self.expect('Data', length, function(data) {
+ self.expect('Data', length, function(data) {
finish(null, data);
});
- }
+ }
}
// decode length
var firstLength = data[1] & 0x7f;
if (firstLength == 0) {
- finish(null, null);
+ finish(null, null);
}
else if (firstLength < 126) {
expectData(firstLength);
@@ -435,11 +435,11 @@
self.expect('Length', 8, function(data) {
expectData(util.unpack(data));
});
- }
+ }
}
}
- this.expect('Opcode', 2, this.processPacket);
+ this.expect('Opcode', 2, this.processPacket);
};
/**
@@ -497,7 +497,7 @@
this.overflow = new Buffer(this.overflow.length + data.length);
prevOverflow.copy(this.overflow, 0);
data.copy(this.overflow, prevOverflow.length);
- }
+ }
}
/**
@@ -531,10 +531,10 @@
if ((data[0] & 0x70) != 0) {
this.error('reserved fields must be empty');
}
- this.state.lastFragment = (data[0] & 0x80) == 0x80;
+ this.state.lastFragment = (data[0] & 0x80) == 0x80;
this.state.masked = (data[1] & 0x80) == 0x80;
var opcode = data[0] & 0xf;
- if (opcode == 0) {
+ if (opcode == 0) {
// continuation frame
this.state.opcode = this.state.activeFragmentedOperation;
if (!(this.state.opcode == 1 || this.state.opcode == 2)) {
@@ -542,7 +542,7 @@
return;
}
}
- else {
+ else {
this.state.opcode = opcode;
if (this.state.lastFragment === false) {
this.state.activeFragmentedOperation = opcode;
@@ -570,7 +570,7 @@
this.state.lastFragment = false;
this.state.opcode = this.state.activeFragmentedOperation != null ? this.state.activeFragmentedOperation : 0;
this.state.masked = false;
- this.expect('Opcode', 2, this.processPacket);
+ this.expect('Opcode', 2, this.processPacket);
}
/**
@@ -603,7 +603,7 @@
if (mask != null) {
for (var i = 0, ll = buf.length; i < ll; i++) {
buf[i] ^= mask[i % 4];
- }
+ }
}
if (binary) return buf;
return buf != null ? buf.toString('utf8') : '';
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment