valyala/fasthttp

how should convert bytesBuffer into http message object。

Open

#763 geöffnet am 13. März 2020

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (1.755 Forks)batch import
help wanted

Repository-Metriken

Stars
 (21.741 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 1T 11h) (34 gemergte PRs in 30 T)

Beschreibung

i learned code below。

func (req *Request) Read(r *bufio.Reader) error {
	return req.ReadLimitBody(r, 0)
}

param r is io buf reader which could be a connection or something else。 i have a scene: goroutine read connection which is a very low eventloop with a fixed size of buffer,i dont wanna chang it。maybe i just get part of http bytes,not a complete http bytes,like chunk。 i cannot use Read method up there。 i did some research,netty has byteToMessageDecoder、envoy use http-parser (c++)https://github.com/nodejs/http-parser can we have this design future?

Contributor Guide