continue read to CurrentLine_
| 204 | |
| 205 | //continue read to CurrentLine_ |
| 206 | bool THttpParser::ReadLine() { |
| 207 | TStringBuf in(Data_, DataEnd_); |
| 208 | size_t endl = in.find('\n'); |
| 209 | |
| 210 | if (Y_UNLIKELY(endl == TStringBuf::npos)) { |
| 211 | //input line not completed |
| 212 | CurrentLine_.append(Data_, DataEnd_); |
| 213 | return false; |
| 214 | } |
| 215 | |
| 216 | CurrentLine_.append(in.data(), endl); |
| 217 | if (Y_LIKELY(CurrentLine_.size())) { |
| 218 | //remove '\r' from tail |
| 219 | size_t withoutCR = CurrentLine_.size() - 1; |
| 220 | if (CurrentLine_[withoutCR] == '\r') { |
| 221 | CurrentLine_.remove(withoutCR); |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | //Cout << "ReadLine:" << CurrentLine_ << Endl; |
| 226 | Data_ += endl + 1; |
| 227 | return true; |
| 228 | } |
| 229 | |
| 230 | void THttpParser::ParseHttpVersion(TStringBuf httpVersion) { |
| 231 | if (!httpVersion.StartsWith("HTTP/", 5)) { |
no test coverage detected