mirror of
https://github.com/fiatjaf/nak.git
synced 2024-11-22 00:09:08 -05:00
use scanner.Buffer() to make stdin able to parse hellish giant events up to 256kb (the default was 64kb).
This commit is contained in:
parent
584881266e
commit
ad7010e506
1
event.go
1
event.go
|
@ -169,6 +169,7 @@ example:
|
|||
tags = append(tags, tag)
|
||||
}
|
||||
}
|
||||
|
||||
for _, etag := range c.StringSlice("e") {
|
||||
tags = append(tags, []string{"e", etag})
|
||||
mustRehashAndResign = true
|
||||
|
|
|
@ -64,6 +64,7 @@ func writeStdinLinesOrNothing(ch chan string) (hasStdinLines bool) {
|
|||
// piped
|
||||
go func() {
|
||||
scanner := bufio.NewScanner(os.Stdin)
|
||||
scanner.Buffer(make([]byte, 16*1024), 256*1024)
|
||||
for scanner.Scan() {
|
||||
ch <- strings.TrimSpace(scanner.Text())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user