Skip to content

Commit

Permalink
Services V2: Fix content length when length > 2 GB
Browse files Browse the repository at this point in the history
Third parameter of std::accumulate determines the return type, so it has
to be explicitly cast to a uint64 to support 64 bit return.

Fixes #555

(cherry picked from commit d364c8b)
  • Loading branch information
bennettpeter committed May 10, 2022
1 parent d80a8da commit c4fc53c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/http/mythhttpranges.cpp
Expand Up @@ -281,7 +281,7 @@ MythHTTPStatus MythHTTPRanges::ParseRanges(const QString& Request, int64_t Total
}

// Sum the expected number of bytes to be sent
PartialSize = std::accumulate(ranges.cbegin(), ranges.cend(), 0, sumrange);
PartialSize = std::accumulate(ranges.cbegin(), ranges.cend(), static_cast<uint64_t>(0), sumrange);
Ranges = ranges;

if (VERBOSE_LEVEL_CHECK(VB_HTTP, LOG_INFO))
Expand Down

0 comments on commit c4fc53c

Please sign in to comment.