summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Guidarelli <ben.guidarelli@gmail.com>2021-12-20 11:30:24 -0500
committerGitHub <noreply@github.com>2021-12-20 11:30:24 -0500
commit0ad9900825f14538847851ed180efa0dbb4ef7df (patch)
tree169b77dacf7aea19d8b00f4bbc6ce6828683d046
parent22a5ebbbe9707f9cce706bcff11347bcf7217e06 (diff)
tealdbg: increase intermediate reading/writing buffers (#3335)
## Summary Some large teal source files cause the tealdbg/cdt session to choke. Upping the buffer size to allow for larger source files. closes #3100 ## Test Plan Run tealdbg with a large source teal file, ensure the source file makes it to cdt without choking.
-rw-r--r--cmd/tealdbg/server.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/cmd/tealdbg/server.go b/cmd/tealdbg/server.go
index 43335921f..d4c3213e0 100644
--- a/cmd/tealdbg/server.go
+++ b/cmd/tealdbg/server.go
@@ -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