Skip to content

Commit 021baf4

Browse files
drewdzzzalyapunov
authored andcommitted
Client: allow to decode data several times
Data contains a pair of iterators, which are considered to be light - let's copy iterator before decoding data to allow to decode the same data several times (or it can be decoded, and then encoded to send to another tarantool from router).
1 parent 4feeb5d commit 021baf4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Client/ResponseReader.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ struct Data {
104104
template<class T>
105105
bool decode(T& tuples)
106106
{
107-
return mpp::decode(iters.first, tuples);
107+
it_t itr = iters.first;
108+
bool ok = mpp::decode(itr, tuples);
109+
assert(itr == iters.second);
110+
return ok;
108111
}
109112

110113
static constexpr auto mpp = &Data<BUFFER>::iters;

0 commit comments

Comments
 (0)