Skip to content

Commit

Permalink
Use 1 MB buffers to avoid silent errors
Browse files Browse the repository at this point in the history
See r3labs/sse#158, "Improve receive message
error handling."

Fixes chmouel#77, "`ERROR gosmee
bufio.Scanner: token too long`".
  • Loading branch information
portante committed Apr 27, 2023
1 parent 05147a0 commit 79756fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gosmee/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func (c goSmee) replayData(pm payloadMsg) error {
func (c goSmee) clientSetup() error {
version := strings.TrimSpace(string(Version))
fmt.Fprintf(os.Stdout, "%sStarting gosmee version: %s\n", c.emoji("⇉", "green+b"), version)
client := sse.NewClient(c.smeeURL)
client := sse.NewClient(c.smeeURL, sse.ClientMaxBufferSize(1<<20))
client.Headers["User-Agent"] = fmt.Sprintf("gosmee/%s", version)
// this is to get nginx to work
client.Headers["X-Accel-Buffering"] = "no"
Expand Down

0 comments on commit 79756fd

Please sign in to comment.