New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nats

Package Overview
Dependencies
Maintainers
3
Versions
198
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nats - npm Package Compare versions

Comparing version 1.4.9-0 to 1.4.9-1

35

lib/nats.js

@@ -705,2 +705,12 @@ /*

/**
* @api private
*/
Client.prototype.clearConnectionTimeoutHandler = function () {
if (this.connectionTimeoutHandler) {
clearTimeout(this.connectionTimeoutHandler)
delete this.connectionTimeoutHandler
}
}
/**
* Properly setup a stream event handlers.

@@ -717,10 +727,9 @@ *

if (this.connectionTimeoutHandler) {
clearTimeout(this.connectionTimeoutHandler)
delete this.connectionTimeoutHandler
}
if (this.options.timeout) {
// tls upgrade will re-bind the handlers here, so if we have a timer we are going to ignore it
if (this.options.timeout && !this.connectionTimeoutHandler) {
this.connectionTimeoutHandler = setTimeout(() => {
stream.destroy(new NatsError(CONN_TIMEOUT_MSG, CONN_TIMEOUT))
if (this.stream) {
// this fires on the current stream
this.stream.destroy(new NatsError(CONN_TIMEOUT_MSG, CONN_TIMEOUT))
}
}, this.options.timeout)

@@ -975,2 +984,3 @@ }

this.stream.destroy()
this.clearConnectionTimeoutHandler()
this.stream = null

@@ -1228,9 +1238,10 @@ }

// add the first callback to a ping
this.pongs.unshift(() => {
this.pongs.unshift((err) => {
if (err) {
// failed the connection
return
}
// this gets called when the first pong is received by the connection
// if we have a connection timeout timer, remove it
if (this.connectionTimeoutHandler) {
clearTimeout(this.connectionTimeoutHandler)
delete this.connectionTimeoutHandler
}
this.clearConnectionTimeoutHandler()
// send any subscriptions, and strip pending

@@ -1237,0 +1248,0 @@ this.sendSubscriptions()

{
"name": "nats",
"version": "1.4.9-0",
"version": "1.4.9-1",
"description": "Node.js client for NATS, a lightweight, high-performance cloud native messaging system",

@@ -5,0 +5,0 @@ "keywords": [

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