Skip to content

Commit

Permalink
Fixed forced debugging. Now only shows when it's asked for.
Browse files Browse the repository at this point in the history
  • Loading branch information
Trakkasure committed May 31, 2011
1 parent de2cd65 commit ebeb50f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,14 @@ function Connection(instance) {
if (!instance.channel[id]) throw('Channel does not exist for ID '+id);
// Make sure that the channel closes itself... so that remaining commands will execute.
if (!instance.channel[id].closed()) return instance.channel[id].close();
//if (instance.debug>0)
if (instance.debug>0)
util.debug('Closing '+this.getHost()+' channel: '+id);
delete instance.channel[id];
if (Object.keys(instance.channel).length==0 && (instance.closing || instance.closeOnDone)) this.close();
},
close:function(force) {
if (!this.connected()) {
//if (instance.debug>0)
if (instance.debug>0)
util.log('Connection disconnected: '+this.getHost());
instance.socket.destroy();
instance.connected=false;
Expand All @@ -396,13 +396,13 @@ function Connection(instance) {
console.log('deferring closing connection');
return;
}
//if (instance.debug>0)
if (instance.debug>0)
util.log('Connection disconnecting: '+this.getHost());
instance.removeAllListeners('done');
var self=this;
if (force) Object.keys(instance.channel).forEach(function(e){self.channel[e].close(true);});
this.once('fatal',function(d){ // quit command ends with a fatal.
//if (instance.debug>0)
if (instance.debug>0)
util.log('Connection disconnected: '+this.getHost());
instance.socket.destroy();
instance.connected=false;
Expand Down Expand Up @@ -547,7 +547,7 @@ function Channel(instance) {
this.closing(true);
if (this.closed()||!force&&(instance.commands.length||this.running())) return;
if (this.running()) this.getConnection().write(['/cancel','=tag='+this.getId()]);
//if (this.getConnection().debug>1)
if (this.getConnection().debug>1)
util.debug('Closing host:channel: '+this.getConnection().getHost()+':'+this.getId());
this.closed(true);
this.getConnection().closeChannel(this.getId());
Expand Down

0 comments on commit ebeb50f

Please sign in to comment.