Skip to content

Commit 67291ed

Browse files
committed
server: emit full params object on server events
Fixes webtorrent#81
1 parent ac17ed7 commit 67291ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Server.prototype.onHttpRequest = function (req, res, opts) {
222222
res.end(bencode.encode(response))
223223

224224
if (params.action === common.ACTIONS.ANNOUNCE) {
225-
self.emit(common.EVENT_NAMES[params.event], params.addr)
225+
self.emit(common.EVENT_NAMES[params.event], params.addr, params)
226226
}
227227
})
228228
}
@@ -262,7 +262,7 @@ Server.prototype.onUdpRequest = function (msg, rinfo) {
262262
}
263263

264264
if (params.action === common.ACTIONS.ANNOUNCE) {
265-
self.emit(common.EVENT_NAMES[params.event], params.addr)
265+
self.emit(common.EVENT_NAMES[params.event], params.addr, params)
266266
}
267267
})
268268
}
@@ -350,7 +350,7 @@ Server.prototype._onWebSocketRequest = function (socket, params) {
350350
}
351351

352352
if (params.action === common.ACTIONS.ANNOUNCE) {
353-
self.emit(common.EVENT_NAMES[params.event], params.peer_id)
353+
self.emit(common.EVENT_NAMES[params.event], params.peer_id, params)
354354
}
355355
})
356356
}

0 commit comments

Comments
 (0)