Clean Solaris build.
[shibboleth/sp.git] / shibsp / handler / impl / StatusHandler.cpp
index 8ce18ec..f090bb0 100644 (file)
@@ -113,7 +113,7 @@ namespace shibsp {
             }
             else
 #endif
-                throw exception("Target parameter was not an absolute URL.");
+                throw invalid_argument("Target parameter was not an absolute URL.");
 
             m_query = strchr(url,'?');
             if (m_query)
@@ -142,26 +142,26 @@ namespace shibsp {
         const char* getScheme() const {
             return m_scheme;
         }
-        const char* getHostname() const {\r
-            return m_hostname.c_str();\r
-        }\r
-        int getPort() const {\r
-            return m_port;\r
-        }\r
-        const char* getRequestURI() const {\r
-            return m_uri.c_str();\r
-        }\r
-        const char* getMethod() const {\r
-            return "GET";\r
-        }\r
-        string getContentType() const {\r
-            return "";\r
-        }\r
-        long getContentLength() const {\r
-            return 0;\r
-        }\r
-        string getRemoteAddr() const {\r
-            return "";\r
+        const char* getHostname() const {
+            return m_hostname.c_str();
+        }
+        int getPort() const {
+            return m_port;
+        }
+        const char* getRequestURI() const {
+            return m_uri.c_str();
+        }
+        const char* getMethod() const {
+            return "GET";
+        }
+        string getContentType() const {
+            return "";
+        }
+        long getContentLength() const {
+            return 0;
+        }
+        string getRemoteAddr() const {
+            return "";
         }
         string getRemoteUser() const {
             return "";
@@ -208,10 +208,10 @@ namespace shibsp {
     private:
         mutable CGIParser* m_parser;
         const char* m_url;
-        const char* m_scheme;\r
-        const char* m_query;\r
-        int m_port;\r
-        string m_hostname,m_uri;\r
+        const char* m_scheme;
+        const char* m_query;
+        int m_port;
+        string m_hostname,m_uri;
     };
 };
 
@@ -244,7 +244,7 @@ pair<bool,long> StatusHandler::run(SPRequest& request, bool isHandler) const
         if (!m_acl.empty() && m_acl.count(request.getRemoteAddr()) == 0) {
             m_log.error("status handler request blocked from invalid address (%s)", request.getRemoteAddr().c_str());
             istringstream msg("Status Handler Blocked");
-            return make_pair(true,request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_FORBIDDEN));
+            return make_pair(true,request.sendResponse(msg, HTTPResponse::XMLTOOLING_HTTP_STATUS_UNAUTHORIZED));
         }
     }
 
@@ -399,8 +399,9 @@ pair<bool,long> StatusHandler::processMessage(
         const PropertySet* relyingParty=NULL;
         param=httpRequest.getParameter("entityID");
         if (param) {
-            Locker mlock(application.getMetadataProvider());
-            relyingParty = application.getRelyingParty(application.getMetadataProvider()->getEntityDescriptor(param));
+            MetadataProvider* m = application.getMetadataProvider();
+            Locker mlock(m);
+            relyingParty = application.getRelyingParty(m->getEntityDescriptor(MetadataProvider::Criteria(param)).first);
         }
         if (!relyingParty)
             relyingParty = application.getRelyingParty(NULL);
@@ -445,6 +446,6 @@ pair<bool,long> StatusHandler::processMessage(
     httpResponse.setContentType("text/xml");
     return make_pair(true, httpResponse.sendResponse(s));
 #else
-    return make_pair(false,0);
+    return make_pair(false,0L);
 #endif
 }