diff options
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/xmlsec/xmlstreamio.cxx | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/xmlsecurity/source/xmlsec/xmlstreamio.cxx b/xmlsecurity/source/xmlsec/xmlstreamio.cxx index de32f8286c1b..910944e11611 100644 --- a/xmlsecurity/source/xmlsec/xmlstreamio.cxx +++ b/xmlsecurity/source/xmlsec/xmlstreamio.cxx @@ -157,21 +157,44 @@ XSECXMLSEC_DLLPUBLIC int xmlEnableStreamInputCallbacks() //Notes: all none default callbacks will lose. xmlSecIOCleanupCallbacks() ; - //Register my classbacks. - int cbs = xmlSecIORegisterCallbacks( - xmlStreamMatch, - xmlStreamOpen, - xmlStreamRead, - xmlStreamClose ) ; - if( cbs < 0 ) { - return -1 ; + // Newer xmlsec wants the callback order in the opposite direction. + if (xmlSecCheckVersionExt(1, 2, 26, xmlSecCheckVersionABICompatible)) + { + //Register the default callbacks. + //Notes: the error will cause xmlsec working problems. + int cbs = xmlSecIORegisterDefaultCallbacks() ; + if( cbs < 0 ) { + return -1 ; + } + + //Register my classbacks. + cbs = xmlSecIORegisterCallbacks( + xmlStreamMatch, + xmlStreamOpen, + xmlStreamRead, + xmlStreamClose ) ; + if( cbs < 0 ) { + return -1 ; + } } - - //Register the default callbacks. - //Notes: the error will cause xmlsec working problems. - cbs = xmlSecIORegisterDefaultCallbacks() ; - if( cbs < 0 ) { - return -1 ; + else + { + //Register my classbacks. + int cbs = xmlSecIORegisterCallbacks( + xmlStreamMatch, + xmlStreamOpen, + xmlStreamRead, + xmlStreamClose ) ; + if( cbs < 0 ) { + return -1 ; + } + + //Register the default callbacks. + //Notes: the error will cause xmlsec working problems. + cbs = xmlSecIORegisterDefaultCallbacks() ; + if( cbs < 0 ) { + return -1 ; + } } enableXmlStreamIO |= XMLSTREAMIO_INITIALIZED ; |