Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

fix: on MultiaddrConnection close() only create timer if needed #262

Merged
merged 2 commits into from
Apr 12, 2023

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Apr 7, 2023

Motivation

  • In MultiaddrConnection.close() it's not necessary to create a timer to finally destroy a socket if we call socket.destroy() already

Description

  • Only create the timer if socket has something to write (if (socket.writableLength > 0) {)

@twoeths twoeths changed the title fix: on MultiaddrConnection close only create timer if needed fix: on MultiaddrConnection close() only create timer if needed Apr 10, 2023
Copy link
Contributor

@dapplion dapplion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@achingbrain achingbrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - please can you check CI and fix the linting errors.

@maschad maschad merged commit 3637489 into libp2p:master Apr 12, 2023
github-actions bot pushed a commit that referenced this pull request Apr 12, 2023
## [6.1.6](v6.1.5...v6.1.6) (2023-04-12)

### Bug Fixes

* on MultiaddrConnection close() only create timer if needed ([#262](#262)) ([3637489](3637489))

### Dependencies

* bump @libp2p/interface-connection from 3.1.1 to 4.0.0 ([#265](#265)) ([d2ef2d0](d2ef2d0))
@github-actions
Copy link

🎉 This PR is included in version 6.1.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@twoeths twoeths deleted the tuyen/timer_on_close branch April 13, 2023 02:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants