New utility create_HTTP_Response_details
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 9 Jul 2013 13:05:37 +0000 (15:05 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 9 Jul 2013 13:05:37 +0000 (15:05 +0200)
include/metaproxy/util.hpp
src/util.cpp

index e5d2768..478e7a4 100644 (file)
@@ -151,6 +151,9 @@ namespace metaproxy_1 {
 
         Z_GDU *create_HTTP_Response(metaproxy_1::Session &session,
                                     Z_HTTP_Request *req, int code);
+        Z_GDU *create_HTTP_Response_details(metaproxy_1::Session &session,
+                                            Z_HTTP_Request *req, int code,
+                                            const char *details);
     private:
         ODR m_odr;
     };
index 4a3d478..aef7caa 100644 (file)
@@ -593,8 +593,9 @@ Z_APDU *mp::odr::create_scanResponse(const Z_APDU *in_apdu,
     return apdu;
 }
 
-Z_GDU *mp::odr::create_HTTP_Response(mp::Session &session,
-                                     Z_HTTP_Request *hreq, int code)
+Z_GDU *mp::odr::create_HTTP_Response_details(mp::Session &session,
+                                             Z_HTTP_Request *hreq, int code,
+                                             const char *details)
 {
     const char *response_version = "1.0";
     bool keepalive = false;
@@ -617,7 +618,7 @@ Z_GDU *mp::odr::create_HTTP_Response(mp::Session &session,
         response_version = "1.1";
     }
 
-    Z_GDU *gdu = z_get_HTTP_Response(m_odr, code);
+    Z_GDU *gdu = z_get_HTTP_Response_details(m_odr, code, details);
     Z_HTTP_Response *hres = gdu->u.HTTP_Response;
     hres->version = odr_strdup(m_odr, response_version);
     if (keepalive)
@@ -626,6 +627,13 @@ Z_GDU *mp::odr::create_HTTP_Response(mp::Session &session,
     return gdu;
 }
 
+Z_GDU *mp::odr::create_HTTP_Response(mp::Session &session,
+                                     Z_HTTP_Request *hreq, int code)
+{
+    return create_HTTP_Response_details(session, hreq, code, 0);
+
+}
+
 Z_ReferenceId **mp_util::get_referenceId(const Z_APDU *apdu)
 {
     switch (apdu->which)