good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
websocket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
github
nhooyr
websocket
Commits
3604edcb
Unverified
Commit
3604edcb
authored
Apr 7, 2021
by
Anmol Sethi
Committed by
GitHub
Apr 7, 2021
Browse files
Options
Downloads
Plain Diff
Merge pull request #291 from nhooyr/dos-56b8
Fix DOS attack from malicious pongs
parents
e4c3b0f8
b0d7a271
Branches
Branches containing commit
Tags
v1.8.7
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ci/container/Dockerfile
+2
-2
2 additions, 2 deletions
ci/container/Dockerfile
conn_notjs.go
+1
-1
1 addition, 1 deletion
conn_notjs.go
read.go
+4
-1
4 additions, 1 deletion
read.go
with
7 additions
and
4 deletions
ci/container/Dockerfile
+
2
−
2
View file @
3604edcb
...
...
@@ -10,5 +10,5 @@ RUN go get golang.org/x/tools/cmd/stringer
RUN
go get golang.org/x/lint/golint
RUN
go get github.com/agnivade/wasmbrowsertest
RUN
npm
install
-g
prettier
RUN
npm
install
-g
netlify-cli
RUN
npm
--unsafe-perm
=
true
install
-g
prettier
RUN
npm
--unsafe-perm
=
true
install
-g
netlify-cli
This diff is collapsed.
Click to expand it.
conn_notjs.go
+
1
−
1
View file @
3604edcb
...
...
@@ -189,7 +189,7 @@ func (c *Conn) Ping(ctx context.Context) error {
}
func
(
c
*
Conn
)
ping
(
ctx
context
.
Context
,
p
string
)
error
{
pong
:=
make
(
chan
struct
{})
pong
:=
make
(
chan
struct
{}
,
1
)
c
.
activePingsMu
.
Lock
()
c
.
activePings
[
p
]
=
pong
...
...
This diff is collapsed.
Click to expand it.
read.go
+
4
−
1
View file @
3604edcb
...
...
@@ -271,7 +271,10 @@ func (c *Conn) handleControl(ctx context.Context, h header) (err error) {
pong
,
ok
:=
c
.
activePings
[
string
(
b
)]
c
.
activePingsMu
.
Unlock
()
if
ok
{
close
(
pong
)
select
{
case
pong
<-
struct
{}{}
:
default
:
}
}
return
nil
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment