diff --git a/lib/manager.js b/lib/manager.js index 24ac4379..4d8836d6 100644 --- a/lib/manager.js +++ b/lib/manager.js @@ -79,6 +79,7 @@ function Manager (server) { , 'browser client': true , 'browser client minification': false , 'browser client etag': false + , 'browser client handler': false }; // reset listeners diff --git a/lib/transports/flashsocket.js b/lib/transports/flashsocket.js index 790fe141..b352f8da 100644 --- a/lib/transports/flashsocket.js +++ b/lib/transports/flashsocket.js @@ -33,6 +33,14 @@ function FlashSocket () { FlashSocket.prototype.__proto__ = WebSocket.prototype; +/** + * Transport name + * + * @api public + */ + +FlashSocket.prototype.name = 'flashsocket'; + /** * Listens for new configuration changes of the Manager * this way we can enable and disable the flash server. diff --git a/lib/transports/htmlfile.js b/lib/transports/htmlfile.js index 9225db21..68aa938b 100644 --- a/lib/transports/htmlfile.js +++ b/lib/transports/htmlfile.js @@ -33,6 +33,14 @@ function HTMLFile (mng, data) { HTMLFile.prototype.__proto__ = HTTPTransport.prototype; +/** + * Transport name + * + * @api public + */ + +HTMLFile.prototype.name = 'htmlfile'; + /** * Handles the request. * @@ -70,5 +78,5 @@ HTMLFile.prototype.write = function (data) { this.drained = true; } - this.log.debug('htmlfile writing', data); + this.log.debug(this.name + ' writing', data); }; diff --git a/lib/transports/http-polling.js b/lib/transports/http-polling.js index a122f988..71ddd648 100644 --- a/lib/transports/http-polling.js +++ b/lib/transports/http-polling.js @@ -35,6 +35,14 @@ function HTTPPolling (mng, data) { HTTPPolling.prototype.__proto__ = HTTPTransport.prototype; +/** + * Transport name + * + * @api public + */ + +HTTPPolling.prototype.name = 'httppolling'; + /** * Removes heartbeat timeouts for polling. */ @@ -56,8 +64,8 @@ HTTPPolling.prototype.handleRequest = function (req) { var self = this; this.pollTimeout = setTimeout(function () { - self.packet({ type: 'noop' }); - self.log.debug('polling closed due to exceeded duration'); + self.close(); + self.log.debug(self.name + ' closed due to exceeded duration'); }, this.manager.get('polling duration') * 1000); this.log.debug('setting poll timeout'); diff --git a/lib/transports/http.js b/lib/transports/http.js index 06e9b8ff..0025abce 100644 --- a/lib/transports/http.js +++ b/lib/transports/http.js @@ -35,6 +35,14 @@ function HTTPTransport (mng, data) { HTTPTransport.prototype.__proto__ = Transport.prototype; +/** + * Transport name + * + * @api public + */ + +HTTPTransport.prototype.name = 'httptransport'; + /** * Handles a request. * @@ -85,7 +93,7 @@ HTTPTransport.prototype.onData = function (data) { var messages = parser.decodePayload(data); for (var i = 0, l = messages.length; i < l; i++) { - this.log.debug('xhr received data packet', data); + this.log.debug(this.name + ' received data packet', data); this.onMessage(messages[i]); } }; diff --git a/lib/transports/jsonp-polling.js b/lib/transports/jsonp-polling.js index 696ea89c..4b16bb69 100644 --- a/lib/transports/jsonp-polling.js +++ b/lib/transports/jsonp-polling.js @@ -40,6 +40,14 @@ function JSONPPolling (mng, data) { JSONPPolling.prototype.__proto__ = HTTPPolling.prototype; +/** + * Transport name + * + * @api public + */ + +JSONPPolling.prototype.name = 'jsonppolling'; + /** * Make sure POST are decoded. */ @@ -65,5 +73,5 @@ JSONPPolling.prototype.doWrite = function (data) { }); this.response.write(data); - this.log.debug('json-p writing', data); + this.log.debug(this.name + ' writing', data); }; diff --git a/lib/transports/websocket.js b/lib/transports/websocket.js index 6eda320c..c6f2bbd7 100644 --- a/lib/transports/websocket.js +++ b/lib/transports/websocket.js @@ -33,7 +33,7 @@ function WebSocket (mng, data) { this.parser = new Parser(); this.parser.on('data', function (packet) { - self.log.debug('websocket received data packet', packet); + self.log.debug(self.name + ' received data packet', packet); self.onMessage(parser.decodePacket(packet)); }); this.parser.on('close', function () { @@ -52,6 +52,14 @@ function WebSocket (mng, data) { WebSocket.prototype.__proto__ = Transport.prototype; +/** + * Transport name + * + * @api public + */ + +WebSocket.prototype.name = 'websocket'; + /** * Called when the socket connects. * @@ -67,7 +75,7 @@ WebSocket.prototype.onSocketConnect = function () { this.buffered = []; if (this.req.headers.upgrade !== 'WebSocket') { - this.log.warn('WebSocket connection invalid'); + this.log.warn(this.name + ' connection invalid'); this.end(); return; } @@ -180,7 +188,7 @@ WebSocket.prototype.write = function (data) { this.end(); } - this.log.debug('websocket writing', data); + this.log.debug(this.name + ' writing', data); } }; @@ -217,7 +225,7 @@ WebSocket.prototype.proveReception = function (headers) { , spaces = k.replace(/[^ ]/g, '').length; if (spaces === 0 || n % spaces !== 0){ - self.log.warn('Invalid WebSocket key: "' + k + '".'); + self.log.warn('Invalid ' + self.name + ' key: "' + k + '".'); self.end(); return false; } diff --git a/lib/transports/xhr-polling.js b/lib/transports/xhr-polling.js index 3a11fc40..8a624538 100644 --- a/lib/transports/xhr-polling.js +++ b/lib/transports/xhr-polling.js @@ -33,6 +33,14 @@ function XHRPolling (mng, data) { XHRPolling.prototype.__proto__ = HTTPPolling.prototype; +/** + * Transport name + * + * @api public + */ + +XHRPolling.prototype.name = 'xhrpolling'; + /** * Frames data prior to write. * @@ -60,5 +68,5 @@ XHRPolling.prototype.doWrite = function (data) { this.response.writeHead(200, headers); this.response.write(data); - this.log.debug('xhr-polling writing', data); + this.log.debug(this.name + ' writing', data); };