Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tealdbg: increase intermediate reading/writing buffers #3335

Merged
merged 3 commits into from
Dec 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions cmd/tealdbg/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,22 @@ import (
"github.com/gorilla/mux"
)

const (
// WebSocketReadBufferSize is the size of the ReadBuffer for the
// tealdbg/cdt websocket session.
// A buffer that is too small will cause the session to choke
// during the `getScriptSource` call and the session cannot recover.
WebSocketReadBufferSize = 81920

// WebSocketWriteBufferSize is the size of the WriteBuffer for the
// tealdbg/cdt websocket session.
// The reasoning for the size is the same as above
WebSocketWriteBufferSize = 81920
)

var upgrader = websocket.Upgrader{
ReadBufferSize: 20480,
WriteBufferSize: 20480,
ReadBufferSize: WebSocketReadBufferSize,
WriteBufferSize: WebSocketWriteBufferSize,
CheckOrigin: func(r *http.Request) bool {
if len(r.Header.Get("Origin")) == 0 {
return true
Expand Down