Skip to content

Replace our custom home-made XML parser with pugixml#858

Merged
lemenkov merged 1 commit intoSIPp:masterfrom
lemenkov:xml_replace_with_pugixml
Mar 12, 2026
Merged

Replace our custom home-made XML parser with pugixml#858
lemenkov merged 1 commit intoSIPp:masterfrom
lemenkov:xml_replace_with_pugixml

Conversation

@lemenkov
Copy link
Copy Markdown
Member

@lemenkov lemenkov commented Mar 9, 2026

Replace custom XML parser with pugixml

Replace the hand-rolled xp_parser with pugixml, a well-tested and widely-used XML parsing library.

Benefits

  • Removes hardcoded limits: No more 64KB file size limit (XP_MAX_FILE_LEN) or 256-level nesting limit (XP_MAX_STACK_LEN)
  • Better XML compliance: Proper handling of edge cases, entities, and malformed input
  • Improved error reporting: Accurate line numbers for parse errors
  • Maintained library: Benefits from upstream bug fixes and security updates
  • Smaller codebase: Net reduction of ~330 lines
  • Battle-tested: pugixml is used by thousands of projects

Approach

The existing xp_... API is preserved, so callers remain unchanged. This minimizes risk and allows gradual migration to direct pugixml usage in the future if desired.

Dependencies

pugixml is bundled by default as a git submodule — no new external dependencies required. Distributions can use -DUSE_SYSTEM_PUGIXML=ON to link against system-installed pugixml instead.

Building

git clone --recursive https://github.com/SIPp/sipp.git
# or for existing clones:
git submodule update --init

Comment thread src/xp_parser.cpp Fixed
Comment thread src/xp_parser.cpp Fixed
@lemenkov lemenkov force-pushed the xml_replace_with_pugixml branch 4 times, most recently from 1cd6415 to 2578f3e Compare March 9, 2026 15:34
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
Assisted-by: Claude (Anthropic) <https://claude.ai>
@lemenkov lemenkov force-pushed the xml_replace_with_pugixml branch from 2578f3e to 60f4ac5 Compare March 9, 2026 15:40
Copy link
Copy Markdown
Contributor

@orgads orgads left a comment

Choose a reason for hiding this comment

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

Is it really needed as a submodule?

Comment thread docker/Dockerfile
@lemenkov lemenkov merged commit 1e5c131 into SIPp:master Mar 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants