| 211 | private: |
| 212 | template <class Operation> |
| 213 | inline size_t Perform(size_t len, const Operation& operation) { |
| 214 | size_t processed = operation(len); |
| 215 | if (processed == 0 && len > 0) { |
| 216 | if (!ChunkedInput_) { |
| 217 | Trailers_.ConstructInPlace(); |
| 218 | } else { |
| 219 | // Read the header of the trailing chunk. It remains in |
| 220 | // the TChunkedInput stream if the HTTP response is compressed. |
| 221 | char symbol; |
| 222 | if (ChunkedInput_->Read(&symbol, 1) != 0) { |
| 223 | ythrow THttpParseException() << "some data remaining in TChunkedInput"; |
| 224 | } |
| 225 | } |
| 226 | } |
| 227 | return processed; |
| 228 | } |
| 229 | |
| 230 | struct TParsedHeaders { |
| 231 | bool Chunked = false; |