Skip to content

Commit ccd31d5

Browse files
Fix large responses with http2 client - extend lifetime with DataSource (#7428)
Co-authored-by: Amaury Chamayou <[email protected]>
1 parent e844c95 commit ccd31d5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/http/http2_types.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@ namespace http2
4444
public:
4545
DataSource() = default;
4646

47-
DataSource(std::span<const uint8_t> s)
48-
{
49-
data.assign(s.begin(), s.end());
50-
span = s;
51-
}
47+
DataSource(std::span<const uint8_t> s) :
48+
DataSource(std::vector<uint8_t>(s.begin(), s.end()))
49+
{}
5250

5351
DataSource(std::vector<uint8_t>&& data_) :
5452
data(std::move(data_)),

0 commit comments

Comments
 (0)