Skip to content

Commit

Permalink
endIndex & console patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal Web committed Aug 5, 2023
1 parent 02e22fa commit 8c20d4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion udsp/encodePacket.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ export async function encodePacket(message, source, destination, headers, footer
} else {
header = id;
}
console.log(message, headers, header);
if (message) {
console.log(message);
}
if (headers) {
console.log(headers);
}
info(`clientId: ${toBase64(id)}`);
info(`Transmit Key ${toBase64(source.sessionKeys.transmitKey)}`);
message.t = Date.now();
Expand Down
4 changes: 2 additions & 2 deletions udsp/request/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ export class Base {
let lastKnownEndIndex = 0;
eachArray(this.incomingDataPackets, (item, index) => {
if (item) {
lastKnownEndIndex = item.endIndex;
lastKnownEndIndex = item.dataIndex;
} else if (missingDataPackets.has(index)) {
missingDataPackets.set(index, true);
}
});
if (missingDataPackets.size !== 0) {
console.log('Missing packets: ', missingDataPackets);
console.log('Last known EndIndex: ', lastKnownEndIndex);
console.log('Last known dataIndex: ', lastKnownEndIndex);
} else if (this.head.dataSize === this.currentIncomingDataSize) {
this.complete();
}
Expand Down

0 comments on commit 8c20d4c

Please sign in to comment.