File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -206,14 +206,11 @@ func (c *Client) ConnectRPC(ctx context.Context) (drpc.Conn, error) {
206
206
return nil , codersdk .ReadBodyAsError (res )
207
207
}
208
208
209
- _ , wsNetConn := codersdk .WebsocketNetConn (ctx , conn , websocket .MessageBinary )
209
+ // Set the read limit to 4 MiB -- about the limit for protobufs. This needs to be larger than
210
+ // the default because some of our protocols can include large messages like startup scripts.
211
+ conn .SetReadLimit (1 << 22 )
212
+ netConn := websocket .NetConn (ctx , conn , websocket .MessageBinary )
210
213
211
- netConn := & closeNetConn {
212
- Conn : wsNetConn ,
213
- closeFunc : func () {
214
- _ = conn .Close (websocket .StatusGoingAway , "ConnectRPC closed" )
215
- },
216
- }
217
214
config := yamux .DefaultConfig ()
218
215
config .LogOutput = nil
219
216
config .Logger = slog .Stdlib (ctx , c .SDK .Logger (), slog .LevelInfo )
You can’t perform that action at this time.
0 commit comments