Nick Kew
2013-09-03 12:03:42 UTC
Igor recently pinged me on IRC to ask about switching
trafficserver's expat use to libxml2. There's a rationale
about libxml2 being a dependency for a range of plugins,
so why not use a single XML parser for everything?
A quick grep reveals that expat is only used in two places
and that its use is extremely brief and straightforward.
I attach a trivial proof-of-concept for switching that to
libxml2. The use of ugly developer #ifdefs can of course
be refined to a working configuration option to select either
expat or libxml2 if folks think it's a worthwhile exercise.
I don't think this is the best way to switch: it's just
what I could hack OTTOMH without having to resort to TFM.
Note that a switch to libxml2 could be the basis for further
development, including probably a switch to use libxml2's
DOM in place of TrafficServer's homebrew partial document
tree. But I'm not volunteering to do that anytime soon.
trafficserver's expat use to libxml2. There's a rationale
about libxml2 being a dependency for a range of plugins,
so why not use a single XML parser for everything?
A quick grep reveals that expat is only used in two places
and that its use is extremely brief and straightforward.
I attach a trivial proof-of-concept for switching that to
libxml2. The use of ugly developer #ifdefs can of course
be refined to a working configuration option to select either
expat or libxml2 if folks think it's a worthwhile exercise.
I don't think this is the best way to switch: it's just
what I could hack OTTOMH without having to resort to TFM.
Note that a switch to libxml2 could be the basis for further
development, including probably a switch to use libxml2's
DOM in place of TrafficServer's homebrew partial document
tree. But I'm not volunteering to do that anytime soon.
--
Nick Kew
Nick Kew