put id in path
This commit is contained in:
+5
-10
@@ -1,8 +1,5 @@
|
||||
import { hri } from 'human-readable-ids';
|
||||
import Debug from 'debug';
|
||||
|
||||
import Client from './Client';
|
||||
import TunnelAgent from './TunnelAgent';
|
||||
const Client = require('./Client');
|
||||
const TunnelAgent = require('./TunnelAgent');
|
||||
|
||||
// Manage sets of clients
|
||||
//
|
||||
@@ -19,8 +16,6 @@ class ClientManager {
|
||||
tunnels: 0
|
||||
};
|
||||
|
||||
this.debug = Debug('lt:ClientManager');
|
||||
|
||||
// This is totally wrong :facepalm: this needs to be per-client...
|
||||
this.graceTimeout = null;
|
||||
}
|
||||
@@ -34,7 +29,7 @@ class ClientManager {
|
||||
|
||||
// can't ask for id already is use
|
||||
if (clients[id]) {
|
||||
id = hri.random();
|
||||
return;
|
||||
}
|
||||
|
||||
const maxSockets = this.opt.max_tcp_sockets;
|
||||
@@ -74,7 +69,7 @@ class ClientManager {
|
||||
}
|
||||
|
||||
removeClient(id) {
|
||||
this.debug('removing client: %s', id);
|
||||
console.debug('removing client: %s', id)
|
||||
const client = this.clients[id];
|
||||
if (!client) {
|
||||
return;
|
||||
@@ -93,4 +88,4 @@ class ClientManager {
|
||||
}
|
||||
}
|
||||
|
||||
export default ClientManager;
|
||||
module.exports = ClientManager;
|
||||
|
||||
Reference in New Issue
Block a user