File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,10 @@ var requiredOpts = {
5959}
6060
6161var optionalOpts = {
62- getAnnounceOpts : function () {
62+ getAnnounceOpts : function (opts ) {
6363 // Provide a callback that will be called whenever announce() is called
64- // internally (on timer), or by the user
64+ // internally (on timer), or by the user.
65+ // this refers to the tracker and opts to the current announce options.
6566 return {
6667 uploaded: 0 ,
6768 downloaded: 0 ,
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ function Client (opts) {
6161 self . destroyed = false
6262
6363 self . _port = opts . port
64- self . _getAnnounceOpts = opts . getAnnounceOpts
64+ self . _getAnnounceOpts = opts . getAnnounceOpts && opts . getAnnounceOpts . bind ( self )
6565 self . _rtcConfig = opts . rtcConfig
6666 self . _userAgent = opts . userAgent
6767
@@ -296,6 +296,6 @@ Client.prototype._defaultAnnounceOpts = function (opts) {
296296 if ( opts . uploaded == null ) opts . uploaded = 0
297297 if ( opts . downloaded == null ) opts . downloaded = 0
298298
299- if ( self . _getAnnounceOpts ) opts = extend ( opts , self . _getAnnounceOpts ( ) )
299+ if ( self . _getAnnounceOpts ) opts = extend ( opts , self . _getAnnounceOpts ( opts ) )
300300 return opts
301301}
You can’t perform that action at this time.
0 commit comments