File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -172,15 +172,16 @@ Tracker.prototype._requestUdp = function (requestUrl, opts) {
172172 var socket = dgram . createSocket ( 'udp4' )
173173 var transactionId = new Buffer ( hat ( 32 ) , 'hex' )
174174
175- if ( opts . event !== 'stopped' ) {
176- // if we're sending a stopped message, we don't really care if it arrives, so don't
177- // set a timer
178- var timeout = setTimeout ( function ( ) {
179- timeout = null
180- cleanup ( )
175+ var stopped = opts . event === 'stopped'
176+ // if we're sending a stopped message, we don't really care if it arrives, so set
177+ // a short timer and don't call error
178+ var timeout = setTimeout ( function ( ) {
179+ timeout = null
180+ cleanup ( )
181+ if ( ! stopped ) {
181182 error ( 'tracker request timed out' )
182- } , 15000 )
183- }
183+ }
184+ } , stopped ? 1500 : 15000 )
184185
185186 if ( timeout && timeout . unref ) {
186187 timeout . unref ( )
You can’t perform that action at this time.
0 commit comments