Skip to content

Tags: coder/websocket

Tags

v1.8.15

Toggle v1.8.15's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
conn: skip timeout callbacks for background contexts (#566)

Every frame read and write registered a context.AfterFunc callback so a
context cancellation could close the connection. context.Background
cannot be canceled because its Done channel is nil, but the code still
constructed, stored, stopped, and cleared a callback registration for
each operation. Skip that work when ctx.Done() is nil, and only clear a
timeout when one was actually installed. BenchmarkConn also joins its
writer goroutine after timing so repeated benchmark runs finish cleanly.

The results below compare parent 7039364 with this commit on an Apple
M4 Max using GOMAXPROCS=1 over 10 samples. A temporary in-package
harness, not included in this commit, repeatedly called one internal
frame read using either context.Background or an uncanceled
context.WithCancel. Header reads parse a minimal frame header; payload
reads copy 512 bytes from a buffered repeating reader.

Before this change, setupReadTimeout called context.AfterFunc even for
context.Background. Avoiding that dead registration reduces background
header reads from 121.95 to 29.94 ns/op and payload reads from 124.17 to
29.15 ns/op. Both fall from 152 B/op and 4 allocs/op to zero.

Cancelable contexts still need an AfterFunc registration, so they
remain at 152 B/op and 4 allocs/op. BenchmarkConn/disabledCompress uses
a cancelable context as well, so it remains at 1219 B/op and 32
allocs/op.

v1.8.14

Toggle v1.8.14's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
refactor: add `ErrMessageTooBig` sentinel error for limited reads (#535)

---------

Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>

v1.8.13

Toggle v1.8.13's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
ci: lock down versions in lint.sh and fix ci (#523)

v1.8.12

Toggle v1.8.12's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #463 from coder/readme-update

Add transfer notice to README

v1.8.11

Toggle v1.8.11's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Merge branch 'dev'

v1.8.10

Toggle v1.8.10's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Merge branch 'dev'

v1.8.9

Toggle v1.8.9's commit message

Verified

This commit was signed with the committer’s verified signature. The key has expired.
Don't embed noCopy...

Whoops.

v1.8.8

Toggle v1.8.8's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request #256 from nhooyr/dev

v1.8.8

v1.8.7

Toggle v1.8.7's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request #291 from nhooyr/dos-56b8

Fix DOS attack from malicious pongs

v1.8.6

Toggle v1.8.6's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request #238 from nhooyr/dev

Fix deadlock introduced in v1.8.5