Commit cb8cd201 authored by vagrant's avatar vagrant
Browse files
parent b1538f51
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -32,8 +32,20 @@ int lost_codec::encode (const LibItsHttp__XmlMessageBodyTypes::XmlBody& msg, OCT
    loggers::get_instance().warning("lost_codec::encode: Unsupported variant");
    return -1;
  }
  data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data());
  loggers::get_instance().log_msg("lost_codec::decode: After encoding: ", data);
  
  // Work-around to be removed when fixed in urn_ietf..._lost.ttcn
  std::string str((const char*)encoding_buffer.get_data(), (const char*)(encoding_buffer.get_data() + encoding_buffer.get_len()));
  loggers::get_instance().log("lost_codec::encode: Before work-around: %s", str.c_str());
  std::size_t it = str.find("pointType");
  if (it != std::string::npos) {
    str = str.substr(0, it + 5) + str.substr(it + 9);
    it = str.find("pointType");
    str = str.substr(0, it + 5) + str.substr(it + 9);
  }
  
  data = OCTETSTRING(str.length(), (const unsigned char*)str.c_str());
  //data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data());
  loggers::get_instance().log_msg("lost_codec::encode: After encoding: ", data);

  loggers::get_instance().log("<<< lost_codec::encode");
  return 0;