mirror of
https://github.com/fiatjaf/nak.git
synced 2024-11-22 08:19:06 -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)
|
tags = append(tags, tag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, etag := range c.StringSlice("e") {
|
for _, etag := range c.StringSlice("e") {
|
||||||
tags = append(tags, []string{"e", etag})
|
tags = append(tags, []string{"e", etag})
|
||||||
mustRehashAndResign = true
|
mustRehashAndResign = true
|
||||||
|
|
|
@ -64,6 +64,7 @@ func writeStdinLinesOrNothing(ch chan string) (hasStdinLines bool) {
|
||||||
// piped
|
// piped
|
||||||
go func() {
|
go func() {
|
||||||
scanner := bufio.NewScanner(os.Stdin)
|
scanner := bufio.NewScanner(os.Stdin)
|
||||||
|
scanner.Buffer(make([]byte, 16*1024), 256*1024)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
ch <- strings.TrimSpace(scanner.Text())
|
ch <- strings.TrimSpace(scanner.Text())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user