Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
  • Loading branch information
pidarped and bzbarsky-apple authored Jun 11, 2024
1 parent 5f31784 commit 190916f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/ReadHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,11 +921,11 @@ void ReadHandler::ClearStateFlag(ReadHandlerFlags aFlag)

size_t ReadHandler::GetReportBufferMaxSize()
{
size_t maxBufSize = chip::app::kMaxSecureSduLengthBytes;
size_t maxBufSize = kMaxSecureSduLengthBytes;
Transport::SecureSession * session = GetSession();
if (session && session->AllowsLargePayload())
{
maxBufSize = chip::app::kMaxLargeSecureSduLengthBytes;
maxBufSize = kMaxLargeSecureSduLengthBytes;
}

return maxBufSize;
Expand Down
5 changes: 3 additions & 2 deletions src/app/ReadHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,10 @@ class ReadHandler : public Messaging::ExchangeDelegate

/*
* Get the appropriate size of a packet buffer to allocate for encoding a Report message.
* Depending on the underlying session, which may or may not support large
* payloads, a buffer with the corresponding max size would be allocated.
* This size might depend on the underlying session used by the ReadHandler.
*
* The size returned here is the size not including the various prepended headers
* (what System::PacketBuffer calls the "available size").
*/
size_t GetReportBufferMaxSize();

Expand Down

0 comments on commit 190916f

Please sign in to comment.