lengthCRLF reports the number of bytes for a trailing "\r\n".
(b []byte)
| 249 | |
| 250 | // lengthCRLF reports the number of bytes for a trailing "\r\n". |
| 251 | func lengthCRLF(b []byte) int { |
| 252 | if j := len(b) - 1; j >= 0 && b[j] == '\n' { |
| 253 | if j := len(b) - 2; j >= 0 && b[j] == '\r' { |
| 254 | return 2 |
| 255 | } |
| 256 | return 1 |
| 257 | } |
| 258 | return 0 |
| 259 | } |
| 260 | |
| 261 | // nextRune returns the next rune in b or utf8.RuneError. |
| 262 | func nextRune(b []byte) rune { |
no outgoing calls
no test coverage detected
searching dependent graphs…