drachtio-srf 4.5.15 → 4.5.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/drachtio-agent.js +2 -1
- package/lib/wire-protocol.js +1 -1
- package/package.json +1 -1
package/lib/drachtio-agent.js
CHANGED
|
@@ -536,7 +536,7 @@ class DrachtioAgent extends Emitter {
|
|
|
536
536
|
debugSocket(`_initServer: removed socket: ${sockPort(socket)}, count now: ${this.mapServer.size}`);
|
|
537
537
|
}
|
|
538
538
|
|
|
539
|
-
_onMsg(socket, msg) {
|
|
539
|
+
_onMsg(socket, msg, {length, start, fullMsg}) {
|
|
540
540
|
const obj = this.mapServer.get(socket) ;
|
|
541
541
|
const pos = msg.indexOf(CR) ;
|
|
542
542
|
const leader = -1 === pos ? msg : msg.slice(0, pos) ;
|
|
@@ -752,6 +752,7 @@ class DrachtioAgent extends Emitter {
|
|
|
752
752
|
|
|
753
753
|
default:
|
|
754
754
|
console.log(`invalid or garbage message: '${msg}'`) ;
|
|
755
|
+
console.log(`buffer start ${start}, length ${length}: '${fullMsg}'`);
|
|
755
756
|
throw new Error('unexpected message with type: ' + token[1]) ;
|
|
756
757
|
}
|
|
757
758
|
}
|
package/lib/wire-protocol.js
CHANGED
|
@@ -267,7 +267,7 @@ module.exports = class WireProtocol extends Emitter {
|
|
|
267
267
|
|
|
268
268
|
do {
|
|
269
269
|
const msg = [...obj.incomingMsg].slice(start, start + length).join('');
|
|
270
|
-
this.emit('msg', socket, msg);
|
|
270
|
+
this.emit('msg', socket, msg, {length, start, fullMsg: obj.incomingMsg});
|
|
271
271
|
obj.incomingMsg = [...obj.incomingMsg].slice(start + length).join('');
|
|
272
272
|
|
|
273
273
|
// check for another message
|