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
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
websocket
Commits
454aee86
Unverified
Commit
454aee86
authored
1 year ago
by
Anmol Sethi
Browse files
Options
Downloads
Patches
Plain Diff
ws_js.go: Disable read limit on -1
Whoops, updates #254 and closes #410
parent
b4e4f4f1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ws_js.go
+3
-2
3 additions, 2 deletions
ws_js.go
with
3 additions
and
2 deletions
ws_js.go
+
3
−
2
View file @
454aee86
...
...
@@ -42,7 +42,7 @@ const (
// Conn provides a wrapper around the browser WebSocket API.
type
Conn
struct
{
noCopy
noCopy
ws
wsjs
.
WebSocket
ws
wsjs
.
WebSocket
// read limit for a message in bytes.
msgReadLimit
xsync
.
Int64
...
...
@@ -138,7 +138,8 @@ func (c *Conn) Read(ctx context.Context) (MessageType, []byte, error) {
if
err
!=
nil
{
return
0
,
nil
,
fmt
.
Errorf
(
"failed to read: %w"
,
err
)
}
if
int64
(
len
(
p
))
>
c
.
msgReadLimit
.
Load
()
{
readLimit
:=
c
.
msgReadLimit
.
Load
()
if
readLimit
>=
0
&&
int64
(
len
(
p
))
>
readLimit
{
err
:=
fmt
.
Errorf
(
"read limited at %v bytes"
,
c
.
msgReadLimit
.
Load
())
c
.
Close
(
StatusMessageTooBig
,
err
.
Error
())
return
0
,
nil
,
err
...
...
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