Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

antena

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

antena - npm Package Compare versions

Comparing version 4.0.5 to 4.0.6

29

lib/node/messaging.js
let BUFFER = Buffer.allocUnsafe(1024);
// https://github.com/nodejs/node/issues/26607
// let BUFFER = Buffer.allocUnsafe(1024);
// function send (message) {
// let bytelength = BUFFER.write(message, 4, "utf8") + 4;
// if (bytelength > BUFFER.length - 8) {
// bytelength = Buffer.byteLength(message, "utf8") + 4;
// BUFFER = Buffer.allocUnsafe(bytelength + 8);
// BUFFER.write(message, 4, "utf8");
// }
// BUFFER.writeUInt32LE(bytelength, 0);
// this.write(BUFFER.slice(0, bytelength));
// };

@@ -12,14 +23,10 @@ module.exports = (socket) => {

function send (message) {
let bytelength = BUFFER.write(message, 4, "utf8") + 4;
if (bytelength > BUFFER.length - 8) {
bytelength = Buffer.byteLength(message, "utf8") + 4;
BUFFER = Buffer.allocUnsafe(bytelength + 8);
BUFFER.write(message, 4, "utf8");
}
BUFFER.writeUInt32LE(bytelength, 0);
this.write(BUFFER.slice(0, bytelength));
};
const body = Buffer.from(message, "utf8");
const head = Buffer.allocUnsafe(4);
head.writeUInt32LE(body.length + 4, 0);
this.write(head);
this.write(body);
}
function ondata (buffer) {
debugger;
while (buffer.length) {

@@ -26,0 +33,0 @@ // Not enough data to compute the message's bytelength

{
"name": "antena",
"description": "Isomorphic communication library for node and browsers",
"version": "4.0.5",
"version": "4.0.6",
"author": {

@@ -6,0 +6,0 @@ "name": "Laurent Christophe",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc