Commit b801649c authored by Yann Garcia's avatar Yann Garcia
Browse files

Bug fixed in Http/Held codec

parent 46e55fd9
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -73,19 +73,19 @@ int held_codec::decode (const OCTETSTRING& p_data, LibItsHttp__XmlMessageBodyTyp
    }
  }
  
  if (it->second.find("<locationRequest") != std::string::npos) {
  if (it->second.find("locationRequest>") != std::string::npos) {
    urn__ietf__params__xml__ns__geopriv__held::LocationRequestType location_request;
    location_request.decode(urn__ietf__params__xml__ns__geopriv__held::LocationRequest_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.locationRequest() = location_request;
  } else if (it->second.find("<locationResponse") != std::string::npos) {
  } else if (it->second.find("locationResponse>") != std::string::npos) {
    urn__ietf__params__xml__ns__geopriv__held::LocationResponseType location_response;
    location_response.decode(urn__ietf__params__xml__ns__geopriv__held::LocationResponse_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.locationResponse() = location_response;
  } else if (it->second.find("<presence") != std::string::npos) {
  } else if (it->second.find("presence>") != std::string::npos) {
    urn__ietf__params__xml__ns__pidf::Presence presence;
    presence.decode(urn__ietf__params__xml__ns__pidf::Presence_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.presence() = presence;
  } else if (it->second.find("<error") != std::string::npos) {
  } else if (it->second.find("error>") != std::string::npos) {
    urn__ietf__params__xml__ns__geopriv__held::Error error;
    error.decode(urn__ietf__params__xml__ns__geopriv__held::Error_descr_, decoding_buffer, TTCN_EncDec::CT_XER, XER_EXTENDED);
    msg.errorType() = error;
+3 −3
Original line number Diff line number Diff line
@@ -601,8 +601,8 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
       LibItsHttp__XmlMessageBodyTypes::XmlBody xml_body;
       // TODO To be refined adding a string identifier to check which codec to use. E.g. held_code.id() returns "xmlns=\"urn:ietf:params:xml:ns:geopriv:held\">"
       if (
           (p["decode_str"].find("xmlns=\"urn:ietf:params:xml:ns:geopriv:held\"") != std::string::npos) ||
           (p["decode_str"].find("xmlns=\"urn:ietf:params:xml:ns:pidf\"") != std::string::npos)
           (p["decode_str"].find("=\"urn:ietf:params:xml:ns:geopriv:held\"") != std::string::npos) ||
           (p["decode_str"].find("=\"urn:ietf:params:xml:ns:pidf\"") != std::string::npos)
           ) {
         loggers::get_instance().log("http_codec::decode_body: Find 'urn:ietf:params:xml:ns:geopriv:held'");
         if (_codecs["held"].get() != nullptr) {
@@ -619,7 +619,7 @@ int http_codec::decode_body(TTCN_Buffer& decoding_buffer, LibItsHttp__MessageBod
           xml_body.raw() = CHARSTRING(body.lengthof(), (char*)static_cast<const unsigned char*>(body));
         }
         message_body.xml__body() = xml_body;
       } else if (p["decode_str"].find("xmlns=\"urn:ietf:params:xml:ns:lost1\"") != std::string::npos) {
       } else if (p["decode_str"].find("=\"urn:ietf:params:xml:ns:lost1\"") != std::string::npos) {
         loggers::get_instance().log("http_codec::decode_body: Find 'urn:ietf:params:xml:ns:lost1'");
         if (_codecs["lost"].get() != nullptr) {
           loggers::get_instance().log("http_codec::decode_body: Call 'lost_codec'");
+17963 −0

File added.

Preview size limit exceeded, changes collapsed.

+1122 −1289

File changed.

Preview size limit exceeded, changes collapsed.

Loading