X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Futil.cpp;h=514553f8893feccb3011278fd1454925a5598e76;hb=6b53d99d063b40491100575eeaa4996303ef21f1;hp=aef7caa77d78264ffc95e7869f96846cb908acbc;hpb=8ff69c27be66eb65b0b5fd6afa4de1a3556d7344;p=metaproxy-moved-to-github.git diff --git a/src/util.cpp b/src/util.cpp index aef7caa..514553f 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,5 +1,5 @@ /* This file is part of Metaproxy. - Copyright (C) 2005-2013 Index Data + Copyright (C) Index Data Metaproxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -500,15 +500,9 @@ void mp_util::transfer_referenceId(ODR odr, const Z_APDU *src, Z_APDU *dst) if (src) { Z_ReferenceId **id_from = mp::util::get_referenceId(src); - if (id_from && *id_from && id_to) - { - *id_to = (Z_ReferenceId*) odr_malloc (odr, sizeof(**id_to)); - (*id_to)->size = (*id_to)->len = (*id_from)->len; - (*id_to)->buf = (unsigned char*) odr_malloc(odr, (*id_to)->len); - memcpy((*id_to)->buf, (*id_from)->buf, (*id_to)->len); - } - else if (id_to) - *id_to = 0; + if (id_from && *id_from) + *id_to = odr_create_Odr_oct(odr, (*id_from)->buf, + (*id_from)->len); } } @@ -618,12 +612,13 @@ Z_GDU *mp::odr::create_HTTP_Response_details(mp::Session &session, response_version = "1.1"; } - Z_GDU *gdu = z_get_HTTP_Response_details(m_odr, code, details); + Z_GDU *gdu = z_get_HTTP_Response_server( + m_odr, code, details, "Metaproxy/" VERSION, + "http://www.indexdata.com/metaproxy"); Z_HTTP_Response *hres = gdu->u.HTTP_Response; hres->version = odr_strdup(m_odr, response_version); if (keepalive) z_HTTP_header_add(m_odr, &hres->headers, "Connection", "Keep-Alive"); - return gdu; }