Commit 75118862 authored by Simon Giesecke's avatar Simon Giesecke
Browse files

Bug 1597211 - Stop processing entries when maximum message size has been...

Bug 1597211 - Stop processing entries when maximum message size has been exceeded. r=dom-workers-and-storage-reviewers,ytausky

Differential Revision: https://phabricator.services.mozilla.com/D53936

--HG--
extra : moz-landing-system : lando
parent e4250194
......@@ -26045,6 +26045,7 @@ nsresult Cursor::CursorOpBase::PopulateExtraResponses(
Key* const aOptPreviousSortKey) {
AssertIsOnConnectionThread();
 
auto accumulatedResponseSize = aInitialResponseSize;
uint32_t extraCount = 0;
do {
bool hasResult;
......@@ -26078,8 +26079,18 @@ nsresult Cursor::CursorOpBase::PopulateExtraResponses(
break;
}
 
// TODO: Check accumulated size of individual responses and maybe break
// early.
// Check accumulated size of individual responses and maybe break early.
accumulatedResponseSize += res.inspect();
if (accumulatedResponseSize > IPC::Channel::kMaximumMessageSize / 2) {
IDB_LOG_MARK_PARENT_TRANSACTION_REQUEST(
"PRELOAD: %s: Dropping entries because maximum message size is "
"exceeded: %" PRIu32 "/%zu bytes",
"Dropping too large", IDB_LOG_ID_STRING(mBackgroundChildLoggingId),
mTransactionLoggingSerialNumber, mLoggingSerialNumber,
aOperation.get(), extraCount, accumulatedResponseSize);
break;
}
 
// TODO: Do not count entries skipped for unique cursors.
++extraCount;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment