From 8ff69c27be66eb65b0b5fd6afa4de1a3556d7344 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 9 Jul 2013 15:05:37 +0200 Subject: [PATCH] New utility create_HTTP_Response_details --- include/metaproxy/util.hpp | 3 +++ src/util.cpp | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/metaproxy/util.hpp b/include/metaproxy/util.hpp index e5d2768..478e7a4 100644 --- a/include/metaproxy/util.hpp +++ b/include/metaproxy/util.hpp @@ -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; }; diff --git a/src/util.cpp b/src/util.cpp index 4a3d478..aef7caa 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -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) -- 1.7.10.4