Is this missed to pass argument in `plugins/multiplexer/dispatch.cc`?
Hi there,
There is this read function in plugins/multiplexer/dispatch.cc:
uint64_t
read(const TSIOBuffer &b, std::string &o, const int64_t l = 0)
{
TSIOBufferReader reader = TSIOBufferReaderAlloc(b);
const uint64_t length = read(reader, o);
TSIOBufferReaderFree(reader);
return length;
}
and it internally calls an overload of the same function
uint64_t
read(const TSIOBufferReader &r, std::string &o, int64_t l = 0)
I think the first function should also forward the l argument to the overload version but it doesn't.
Currently this doesn't seem to break anything because of the current usages of the read functions.
So, does this need to be fixed?
It looks like the both read functions are only used to read whole data in a buffer. Forwarding the l argument is a valid change, but I'd remove the l arguments from the both. I don't think it's worth keeping them because they are local functions and we can add them back easily if needed.
It seems to me that this version of the function
uint64_t read(const TSIOBufferReader &r, std::string &o, int64_t l = 0)
is called by
void Handler::data(const TSIOBufferReader r, const int64_t l)
where the l argument is passed to the read function.
So, it seems that I can't remove it from there.
Maybe I misunderstood what you wrote above?
Ah, I missed the use in Handler::data. Then just from the TSIOBuffer version.