Start to clean up Unix build.
[shibboleth/cpp-sp.git] / apache / mod_apache.cpp
index 319820c..4b2b9c8 100644 (file)
@@ -22,6 +22,8 @@
  * $Id$
  */
 
+#define SHIBSP_LITE
+
 #ifdef SOLARIS2
 #undef _XOPEN_SOURCE    // causes gethostname conflict in unistd.h
 #endif
@@ -44,6 +46,7 @@
 #include <xmltooling/XMLToolingConfig.h>
 #include <xmltooling/util/NDC.h>
 #include <xmltooling/util/Threads.h>
+#include <xmltooling/util/XMLConstants.h>
 #include <xmltooling/util/XMLHelper.h>
 
 #ifdef WIN32
@@ -268,7 +271,7 @@ class ShibTargetApache : public AbstractSPRequest
 {
   mutable string m_body;
   mutable bool m_gotBody;
-  vector<XSECCryptoX509*> m_certs;
+  vector<string> m_certs;
 
 public:
   request_rec* m_req;
@@ -326,13 +329,15 @@ public:
     if (m_gotBody || m_req->method_number==M_GET)
         return m_body.c_str();
     // Read the posted data
-    if (ap_setup_client_block(m_req, REQUEST_CHUNKED_DECHUNK)) {
+    if (ap_setup_client_block(m_req, REQUEST_CHUNKED_DECHUNK) != OK) {
         m_gotBody=true;
         log(SPError, "Apache function (setup_client_block) failed while reading request body.");
+        return m_body.c_str();
     }
     if (!ap_should_client_block(m_req)) {
         m_gotBody=true;
         log(SPError, "Apache function (should_client_block) failed while reading request body.");
+        return m_body.c_str();
     }
     if (m_req->remaining > 1024*1024)
         throw opensaml::SecurityPolicyException("Blocked request body larger than 1M size limit.");
@@ -415,13 +420,13 @@ public:
         in.read(buf,1024);
         ap_rwrite(buf,in.gcount(),m_req);
     }
-    return ((status==SAML_HTTP_STATUS_OK) ? DONE : status);
+    return ((status==XMLTOOLING_HTTP_STATUS_OK) ? DONE : status);
   }
   long sendRedirect(const char* url) {
     ap_table_set(m_req->headers_out, "Location", url);
     return REDIRECT;
   }
-  const vector<XSECCryptoX509*>& getClientCertificates() const {
+  const vector<string>& getClientCertificates() const {
       return m_certs;
   }
   long returnDecline(void) { return DECLINED; }
@@ -585,7 +590,7 @@ public:
     pair<bool,const XMLCh*> getXMLString(const char* name, const char* ns=NULL) const;
     pair<bool,unsigned int> getUnsignedInt(const char* name, const char* ns=NULL) const;
     pair<bool,int> getInt(const char* name, const char* ns=NULL) const;
-    const PropertySet* getPropertySet(const char* name, const char* ns="urn:mace:shibboleth:target:config:1.0") const;
+    const PropertySet* getPropertySet(const char* name, const char* ns="urn:mace:shibboleth:2.0:native:sp:config") const;
     const xercesc::DOMElement* getElement() const;
 
 private: