improve ScanRequest doc string

This commit is contained in:
Hedy Li 2021-08-02 17:39:23 +08:00
parent 70f0c6683e
commit ae99c4b44f
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 1 additions and 1 deletions

View File

@ -319,7 +319,7 @@ func parseRequest(r string) (host, path string, contentLength int, err error) {
return
}
// ScanRequest is like bufio.ScanBytes but returns a byte if no more \n is found
// ScanRequest returns a line if we haven't scanned request line yet, else, returns a byte
func ScanRequest(data []byte, atEOF bool) (advance int, token []byte, err error) {
if atEOF && len(data) == 0 {
return 0, nil, nil