Lines Matching refs:buffer

41 	\brief Parse the status from the \a buffer and store it in \a status.
44 \retval false There is not enough data in the buffer for a full status.
49 HttpParser::ParseStatus(HttpBuffer& buffer, BHttpStatus& status)
54 auto statusLine = buffer.GetNextLine();
84 \brief Parse the fields from the \a buffer and store it in \a fields.
87 \a buffer, it will still parse all complete fields and store them in the \a fields.
94 \retval false There is not enough data in the buffer to complete parsing of fields.
99 HttpParser::ParseFields(HttpBuffer& buffer, BHttpFields& fields)
104 auto fieldLine = buffer.GetNextLine();
109 fieldLine = buffer.GetNextLine();
196 \brief Parse the body from the \a buffer and use \a writeToBody function to save.
198 The \a readEnd parameter indicates to the parser that the buffer currently contains all the
202 HttpParser::ParseBody(HttpBuffer& buffer, HttpTransferFunction writeToBody, bool readEnd)
207 auto parseResult = fBodyParser->ParseBody(buffer, writeToBody, readEnd);
308 \brief Parse a regular (non-chunked) body from a buffer.
310 The buffer is parsed into a target using the \a writeToBody function.
312 The \a readEnd argument indicates whether the current \a buffer contains all the expected data.
313 In case the total body size is known, and the remaining bytes in the buffer are smaller than
314 the expected remainder, a ProtocolError will be raised. The data in the buffer will *not* be
317 Also, if the body size is known, and the data in the \a buffer is larger than the expected
318 expected length, then it will only read the bytes needed and leave the remainder in the buffer.
323 \exception BNetworkRequestError In case the buffer contains too little or invalid data.
325 \returns The number of bytes parsed from the \a buffer.
328 HttpRawBodyParser::ParseBody(HttpBuffer& buffer, HttpTransferFunction writeToBody, bool readEnd)
330 auto bytesToRead = buffer.RemainingBytes();
333 if (expectedRemainingBytes < static_cast<off_t>(buffer.RemainingBytes()))
335 else if (readEnd && expectedRemainingBytes > static_cast<off_t>(buffer.RemainingBytes())) {
342 auto bytesRead = buffer.WriteTo(writeToBody, bytesToRead);
373 \brief Parse a chunked body from a buffer.
377 The \a readEnd argument indicates whether the current \a buffer contains all the expected data.
383 \exception BNetworkRequestError In case there is an error parsing the buffer, or there is too
386 \returns The number of bytes parsed from the \a buffer.
389 HttpChunkedBodyParser::ParseBody(HttpBuffer& buffer, HttpTransferFunction writeToBody, bool readEnd)
392 while (buffer.RemainingBytes() > 0) {
396 // Read the next chunk size from the buffer; if unsuccesful wait for more data
397 auto chunkSizeString = buffer.GetNextLine();
426 if (fRemainingChunkSize > static_cast<off_t>(buffer.RemainingBytes()))
427 bytesToRead = buffer.RemainingBytes();
431 auto bytesRead = buffer.WriteTo(writeToBody, bytesToRead);
449 if (buffer.RemainingBytes() < 2) {
450 // not enough data in the buffer to finish the chunk
453 auto chunkEndString = buffer.GetNextLine();
466 auto trailerString = buffer.GetNextLine();
518 The \a readEnd argument indicates whether the current \a buffer contains all the expected data.
525 \exception BNetworkRequestError In case there is an error parsing the buffer, or there is too
528 \returns The number of bytes parsed from the \a buffer.
531 HttpBodyDecompression::ParseBody(HttpBuffer& buffer, HttpTransferFunction writeToBody, bool readEnd)
535 buffer,
536 [this](const std::byte* buffer, size_t bufferSize) {
537 auto status = fDecompressingStream->WriteExactly(buffer, bufferSize);