Skip to content

Commit

Permalink
Fix -v RpcData
Browse files Browse the repository at this point in the history
  • Loading branch information
Fanda Vacek committed Dec 17, 2024
1 parent bc8c0a8 commit c807222
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SHVCHAINPACK_DECL_EXPORT AbstractStreamReader
virtual void read(RpcValue::MetaData &meta_data) = 0;
virtual void read(RpcValue &val) = 0;

ssize_t readCount() const;
int64_t readCount() const;
protected:
// NOLINTNEXTLINE(cppcoreguidelines-avoid-const-or-ref-data-members)
std::istream &m_in;
Expand Down
2 changes: 1 addition & 1 deletion libshvchainpack/src/abstractstreamreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ RpcValue AbstractStreamReader::read(std::string *error)
return ret;
}

ssize_t AbstractStreamReader::readCount() const
int64_t AbstractStreamReader::readCount() const
{
auto count = m_in.tellg();
if (count >= 0) {
Expand Down
1 change: 0 additions & 1 deletion libshvchainpack/src/rpcdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ void RpcDriver::sendRpcFrame(RpcFrame &&frame)
writeFrame(frame2);
}
else {
//logRpcData().nospace() << "FRAME DATA WRITE " << frame_data.size() << " bytes of data:\n" << shv::chainpack::utils::hexDump(frame_data);
writeFrame(frame);
}
}
Expand Down
3 changes: 3 additions & 0 deletions libshviotqt/src/rpc/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ void FrameWriter::addFrame(const chainpack::RpcFrame &frame)
{
try {
auto frame_head = frame.toFrameHead();
logRpcData().nospace() << "FRAME DATA WRITE " << (frame_head.length() + frame.data.length())
<< " bytes of data:\n"
<< [&frame_head, &frame]() { return shv::chainpack::utils::hexDump(frame_head + frame.data); }();
addFrameData(frame_head, frame.data);
} catch (const std::runtime_error &e) {
shvWarning() << "Error converting frame to data:" << e.what();
Expand Down

0 comments on commit c807222

Please sign in to comment.