Skip to content
Browse files

Reduce arguments to connectAgent.

  • Loading branch information...
1 parent ccbfd6f commit a347350dc5987b4954fb4fa671c99b41828e8c29 @reid reid committed Mar 21, 2013
Showing with 8 additions and 4 deletions.
  1. +7 −3 lib/hub/all-agents.js
  2. +1 −1 lib/hub/index.js
View
10 lib/hub/all-agents.js
@@ -157,12 +157,16 @@ AllAgents.prototype.findTargetForNewAgent = function (agent) {
* given ID.
*
* @method connectAgent
- * @param {Number} id Agent ID.
- * @param {String} ua User-Agent.
+ * @param {Object} message Registration data.
+ * @param {String} message.agentId Agent ID.
+ * @param {String} [message.ua] User-Agent.
+ * @param {String} [message.originId] Origin ID.
* @param {SimpleEvents} socket Socket.
*/
-AllAgents.prototype.connectAgent = function (id, ua, socket) {
+AllAgents.prototype.connectAgent = function (message, socket) {
var self = this,
+ id = message.agentId,
+ ua = message.ua,
firstConnect = false,
agent = self.agents[id],
mountpoint = self.hub.mountpoint,
View
2 lib/hub/index.js
@@ -269,7 +269,7 @@ Hub.prototype._onTowerConnection = function (socket) {
client.emit("error", "ID required");
}
- self.allAgents.connectAgent(id, message.ua, client);
+ self.allAgents.connectAgent(message, client);
self.debug("SockJS register done");
client.emit("ready", id);

0 comments on commit a347350

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