File tree 1 file changed +10
-10
lines changed
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -135,18 +135,18 @@ ProxyServer.prototype.listen = function(port, hostname) {
135
135
} ;
136
136
137
137
ProxyServer . prototype . close = function ( callback ) {
138
+ var self = this ;
138
139
if ( this . _server ) {
139
- // Wrap callback to nullify server after all open connections are closed.
140
- var callback_wrapper = function ( ) {
141
- this . _server = null ;
142
-
143
- if ( callback ) {
144
- callback ( arguments ) ;
145
- }
146
- } ;
147
-
148
- this . _server . close ( callback_wrapper ) ;
140
+ this . _server . close ( done ) ;
149
141
}
142
+
143
+ // Wrap callback to nullify server after all open connections are closed.
144
+ function done ( ) {
145
+ self . _server = null ;
146
+ if ( callback ) {
147
+ callback . apply ( null , arguments ) ;
148
+ }
149
+ } ;
150
150
} ;
151
151
152
152
ProxyServer . prototype . before = function ( type , passName , callback ) {
You can’t perform that action at this time.
0 commit comments