func (b *bufioR) PeekLine(offset int) (bufioLn, error) {
	index := -1

	// try to find the end of the line
	start := b.r + offset
	if start < b.w {
		index = bytes.IndexByte(b.buf[start:b.w], '\r')
	}

	// try to read more data into the buffer if not in the buffer
	if index < 0 {
		if err := b.fill(); err != nil {
			return nil, err
		}
		start = b.r + offset
		if start < b.w {
			index = bytes.IndexByte(b.buf[start:b.w], '\r')
		}
	}

	// fail if still nothing found
	if index < 0 {
		return nil, errInlineRequestTooLong
	}

	// FIXED: Ensure there is (offset + index + 2) to read.
	if (start + index + 1) >= b.w {
		// fmt.Println("CR read without LF")
		b.require(offset + index + 2)
		start = b.r + offset
	}
	// Proved to be not a problem
	// if b.buf[start + index + 1] != '\n' {
	// 	fmt.Printf("Detected non LF after CR: %v", b.buf[start : start + index + 2])
	// 	return bufioLn(b.buf[start : start + index + 1]), nil
	// }
	return bufioLn(b.buf[start : start+index+2]), nil
}
// PeekLine returns the next line until CRLF without reading it
PeekLine returns the next line until CRLF without reading it
// PeekLine returns the next line until CRLF without reading it
func (b *bufioR) PeekLine(offset int) (bufioLn, error) {
	index := -1
	start := b.r + offset
	if start < b.w {
		index = bytes.IndexByte(b.buf[start:b.w], '\r')
	}
	if index < 0 {
		if err := b.fill(); err != nil {
			return nil, err
		}
		start = b.r + offset
		if start < b.w {
			index = bytes.IndexByte(b.buf[start:b.w], '\r')
		}
	}
	if index < 0 {
		return nil, errInlineRequestTooLong
	}
	if (start + index + 1) >= b.w {
		b.require(offset + index + 2)
		start = b.r + offset
	}
	return bufioLn(b.buf[start : start+index+2]), nil
}
func ( b * bufioR ) PeekLine ( offset int ) ( bufioLn , error ) { index := - 1 start := b . r + offset if start < b . w { index = bytes . IndexByte ( b . buf [ start : b . w ] , '\r' ) } if index < 0 { if err := b . fill ( ) ; err != nil { return nil , err } start = b . r + offset if start < b . w { index = bytes . IndexByte ( b . buf [ start : b . w ] , '\r' ) } } if index < 0 { return nil , errInlineRequestTooLong } if ( start + index + 1 ) >= b . w { b . require ( offset + index + 2 ) start = b . r + offset } return bufioLn ( b . buf [ start : start + index + 2 ] ) , nil }
PeekLine returns the next line until CRLF without reading it
PeekLine returns the next line until CRLF without reading it
// try to find the end of the line // try to read more data into the buffer if not in the buffer // fail if still nothing found // FIXED: Ensure there is (offset + index + 2) to read. // fmt.Println("CR read without LF") // Proved to be not a problem // if b.buf[start + index + 1] != '\n' { // 	fmt.Printf("Detected non LF after CR: %v", b.buf[start : start + index + 2]) // 	return bufioLn(b.buf[start : start + index + 1]), nil // }