@@ -147,7 +147,7 @@ Server.prototype._onHttpRequest = function (req, res) {
147147 // even though it's an error for the client, it's just a warning for the server.
148148 // don't crash the server because a client sent bad data :)
149149 self . emit ( 'warning' , error )
150-
150+
151151 return
152152 }
153153
@@ -185,7 +185,7 @@ Server.prototype._onUdpRequest = function (msg, rinfo) {
185185 'failure reason' : err . message
186186 }
187187 }
188-
188+
189189 var socket = dgram . createSocket ( 'udp4' )
190190 response . transactionId = params . transactionId
191191 response . connectionId = params . connectionId
@@ -199,7 +199,6 @@ Server.prototype._onUdpRequest = function (msg, rinfo) {
199199}
200200
201201Server . prototype . _onRequest = function ( params , cb ) {
202- var response
203202 if ( params && params . action === common . ACTIONS . CONNECT ) {
204203 cb ( null , { action : common . ACTIONS . CONNECT } )
205204 } else if ( params && params . action === common . ACTIONS . ANNOUNCE ) {
@@ -230,21 +229,21 @@ Server.prototype._onAnnounce = function (params, cb) {
230229
231230Server . prototype . _onScrape = function ( params , cb ) {
232231 var self = this
233-
232+
234233 if ( typeof params . info_hash === 'string' ) {
235234 params . info_hash = [ params . info_hash ]
236235 } else if ( params . info_hash == null ) {
237236 // if info_hash param is omitted, stats for all torrents are returned
238237 // TODO: make this configurable!
239238 params . info_hash = Object . keys ( self . torrents )
240239 }
241-
240+
242241 if ( ! Array . isArray ( params . info_hash ) ) {
243242 var err = new Error ( 'invalid info_hash' )
244243 self . emit ( 'warning' , err )
245244 return cb ( err )
246245 }
247-
246+
248247 var response = {
249248 action : common . ACTIONS . SCRAPE ,
250249 files : { } ,
@@ -256,7 +255,7 @@ Server.prototype._onScrape = function (params, cb) {
256255 series ( params . info_hash . map ( function ( infoHash ) {
257256 var swarm = self . getSwarm ( infoHash )
258257 return function ( cb ) {
259- swarm . scrape ( infoHash , params , function ( err , scrapeInfo ) {
258+ swarm . scrape ( params , function ( err , scrapeInfo ) {
260259 cb ( err , scrapeInfo && {
261260 infoHash : infoHash ,
262261 complete : scrapeInfo . complete || 0 ,
0 commit comments