Home | History | Annotate | Download | only in http

Lines Matching refs:buf_len

69 int HttpChunkedDecoder::FilterBuf(char* buf, int buf_len) {
72 while (buf_len) {
74 int num = std::min(chunk_remaining_, buf_len);
76 buf_len -= num;
87 bytes_after_eof_ += buf_len;
91 int bytes_consumed = ScanForChunkRemaining(buf, buf_len);
95 buf_len -= bytes_consumed;
96 if (buf_len)
97 memmove(buf, buf + bytes_consumed, buf_len);
103 int HttpChunkedDecoder::ScanForChunkRemaining(const char* buf, int buf_len) {
105 DCHECK_GT(buf_len, 0);
109 size_t index_of_lf = base::StringPiece(buf, buf_len).find('\n');
111 buf_len = static_cast<int>(index_of_lf);
112 if (buf_len && buf[buf_len - 1] == '\r') // Eliminate a preceding CR.
113 buf_len--;
118 line_buf_.append(buf, buf_len);
120 buf_len = static_cast<int>(line_buf_.size());
124 if (buf_len)
129 if (buf_len) {
134 } else if (buf_len) {
136 size_t index_of_semicolon = base::StringPiece(buf, buf_len).find(';');
138 buf_len = static_cast<int>(index_of_semicolon);
140 if (!ParseChunkSize(buf, buf_len, &chunk_remaining_)) {
142 std::string(buf, buf_len);
155 bytes_consumed = buf_len;
158 if (buf[buf_len - 1] == '\r')
159 buf_len--;
161 if (line_buf_.length() + buf_len > kMaxLineBufLen) {
166 line_buf_.append(buf, buf_len);