Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions esp/bindings/SOAP/xpp/fxpp/FragmentedXmlPullParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,12 @@ class CFragmentedXmlPullParser : public IFragmentedXmlPullParser
}
else
{
do
for (uint8_t i=0; i<=laIndex; ++i)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asselitx where is this code used? How many data frames are typical.

This code is O(N^2) in the number of frames. Each call to peekDataFrame walks a std::list until it finds the match.

@asselitx asselitx Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ghalliday The number of cumulative frames iterated in the outer laIndex (lookahead Index) loop is small - about 10. Each call to peekDataFrame bounds the number it iterates by the index passed in. That index is trying to match an end tag for a node that will be replaced by imported content. Since the lookahead is going over at most a start + content + whitespace + end XML nodes it won't be more than [0..3]. So although the number of frames overall in the pendingData() list could be larger it is only looking over the last laIndex of them.

{
la = peekDataFrame(laIndex);
la = peekDataFrame(i);
if (la)
la->state = DataFrame::FrameIgnored;
}
while (laIndex-- != 0);
pushFragment(injector.m_frame.getLink());
}
}
Expand Down
2 changes: 1 addition & 1 deletion esp/services/ws_machine/ws_machineService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ void Cws_machineEx::setProcessRequest(CGetMachineInfoData& machineInfoData, Bool
processTypeStr = processType;
}

while (numIps--)
for (unsigned i=0; i<numIps; ++i)
{
unsigned numAddr;
if (ipAddr.getNetAddress(sizeof(numAddr),&numAddr)!=sizeof(numAddr))
Expand Down
Loading