ClientHttpRequest::prepPartialResponseGeneration()
{
    assert(request);
    assert(request->range);

    range_iter.pos = request->range->begin();
    range_iter.end = request->range->end();
    range_iter.debt_size = 0;
    const auto multipart = request->range->specs.size() > 1;
    if (multipart)
        range_iter.boundary = rangeBoundaryStr();
    range_iter.valid = true; // TODO: Remove.
    range_iter.updateSpec(); // TODO: Refactor to initialize rather than update.

    assert(range_iter.pos != range_iter.end);
    const auto &firstRange = *range_iter.pos;
    assert(firstRange);
    out.offset = firstRange->offset;

    return multipart ? mRangeCLen() : firstRange->length;
}
ClientHttpRequest::prepPartialResponseGeneration()
{
    assert(request);
    assert(request->range);

    range_iter.pos = request->range->begin();
    range_iter.end = request->range->end();
    range_iter.debt_size = 0;
    const auto multipart = request->range->specs.size() > 1;
    if (multipart)
        range_iter.boundary = rangeBoundaryStr();
    range_iter.valid = true;  
    range_iter.updateSpec();  

    assert(range_iter.pos != range_iter.end);
    const auto &firstRange = *range_iter.pos;
    assert(firstRange);
    out.offset = firstRange->offset;

    return multipart ? mRangeCLen() : firstRange->length;
}