VS10 solution files, convert from NULL macro to nullptr.
[shibboleth/sp.git] / shibsp / handler / impl / SAML2LogoutInitiator.cpp
index 1dc10d6..a776bc3 100644 (file)
@@ -89,7 +89,7 @@ namespace shibsp {
         string m_appId;
 #ifndef SHIBSP_LITE
         LogoutRequest* buildRequest(
-            const Application& application, const Session& session, const RoleDescriptor& role, const MessageEncoder* encoder=NULL
+            const Application& application, const Session& session, const RoleDescriptor& role, const MessageEncoder* encoder=nullptr
             ) const;
 
         XMLCh* m_outgoing;
@@ -112,7 +112,7 @@ namespace shibsp {
 SAML2LogoutInitiator::SAML2LogoutInitiator(const DOMElement* e, const char* appId)
     : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".LogoutInitiator.SAML2")), m_appId(appId),
 #ifndef SHIBSP_LITE
-        m_outgoing(NULL),
+        m_outgoing(nullptr),
 #endif
         m_protocol(samlconstants::SAML20P_NS)
 {
@@ -141,7 +141,7 @@ SAML2LogoutInitiator::SAML2LogoutInitiator(const DOMElement* e, const char* appI
             try {
                 auto_ptr_char b(start);
                 MessageEncoder * encoder =
-                    SAMLConfig::getConfig().MessageEncoderManager.newPlugin(b.get(),pair<const DOMElement*,const XMLCh*>(e,NULL));
+                    SAMLConfig::getConfig().MessageEncoderManager.newPlugin(b.get(),pair<const DOMElement*,const XMLCh*>(e,nullptr));
                 if (encoder->isUserAgentPresent()) {
                     m_encoders[start] = encoder;
                     m_log.debug("supporting outgoing binding (%s)", b.get());
@@ -192,7 +192,7 @@ pair<bool,long> SAML2LogoutInitiator::run(SPRequest& request, bool isHandler) co
     // At this point we know the front-channel is handled.
     // We need the session to do any other work.
 
-    Session* session = NULL;
+    Session* session = nullptr;
     try {
         session = request.getSession(false, true, false);  // don't cache it and ignore all checks
         if (!session)
@@ -233,7 +233,7 @@ void SAML2LogoutInitiator::receive(DDF& in, ostream& out)
 
     // Find application.
     const char* aid=in["application_id"].string();
-    const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : NULL;
+    const Application* app=aid ? SPConfig::getConfig().getServiceProvider()->getApplication(aid) : nullptr;
     if (!app) {
         // Something's horribly wrong.
         m_log.error("couldn't find application (%s) for logout", aid ? aid : "(missing)");
@@ -244,13 +244,13 @@ void SAML2LogoutInitiator::receive(DDF& in, ostream& out)
     auto_ptr<HTTPRequest> req(getRequest(in));
 
     // Set up a response shim.
-    DDF ret(NULL);
+    DDF ret(nullptr);
     DDFJanitor jout(ret);
     auto_ptr<HTTPResponse> resp(getResponse(ret));
 
-    Session* session = NULL;
+    Session* session = nullptr;
     try {
-         session = app->getServiceProvider().getSessionCache()->find(*app, *req.get(), NULL, NULL);
+         session = app->getServiceProvider().getSessionCache()->find(*app, *req.get(), nullptr, nullptr);
     }
     catch (exception& ex) {
         m_log.error("error accessing current session: %s", ex.what());
@@ -314,8 +314,8 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
                 );
         }
 
-        const EndpointType* ep=NULL;
-        const MessageEncoder* encoder=NULL;
+        const EndpointType* ep=nullptr;
+        const MessageEncoder* encoder=nullptr;
         vector<const XMLCh*>::const_iterator b;
         for (b = m_bindings.begin(); b!=m_bindings.end(); ++b) {
             if (ep=EndpointManager<SingleLogoutService>(role->getSingleLogoutServices()).getByBinding(*b)) {
@@ -331,7 +331,7 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
             shibsp::SOAPClient soaper(policy);
             MetadataCredentialCriteria mcc(*role);
 
-            LogoutResponse* logoutResponse=NULL;
+            LogoutResponse* logoutResponse=nullptr;
             auto_ptr_XMLCh binding(samlconstants::SAML20_BINDING_SOAP);
             const vector<SingleLogoutService*>& endpoints=role->getSingleLogoutServices();
             for (vector<SingleLogoutService*>::const_iterator epit=endpoints.begin(); !logoutResponse && epit!=endpoints.end(); ++epit) {
@@ -365,7 +365,7 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
             }
             else {
                 // Check the status, looking for non-success or a partial logout code.
-                const StatusCode* sc = logoutResponse->getStatus() ? logoutResponse->getStatus()->getStatusCode() : NULL;
+                const StatusCode* sc = logoutResponse->getStatus() ? logoutResponse->getStatus()->getStatusCode() : nullptr;
                 bool partial = (!sc || !XMLString::equals(sc->getValue(), StatusCode::SUCCESS));
                 if (!partial && sc->getStatusCode()) {
                     // Success, but still need to check for partial.
@@ -386,7 +386,7 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
 
             if (session) {
                 session->unlock();
-                session = NULL;
+                session = nullptr;
                 application.getServiceProvider().getSessionCache()->remove(application, httpRequest, &httpResponse);
             }
 
@@ -415,7 +415,7 @@ pair<bool,long> SAML2LogoutInitiator::doRequest(
 
     if (session) {
         session->unlock();
-        session = NULL;
+        session = nullptr;
         application.getServiceProvider().getSessionCache()->remove(application, httpRequest, &httpResponse);
     }