if(e.size() > 63)
throw std::range_error("label too long");
d_storage.append(1, (char)e.size());
- d_storage.append(e);
+ d_storage.append(e.c_str(), e.length());
}
}
std::string DNSName::toDNSString() const
{
- string ret(d_storage);
+ string ret(d_storage.c_str(), d_storage.length());
ret.append(1,(char)0);
return ret;
}
if(label.size() > 63)
throw std::range_error("label too long");
d_storage.append(1, (char)label.size());
- d_storage.append(label);
+ d_storage.append(label.c_str(), label.length());
}
void DNSName::prependRawLabel(const std::string& label)
if(label.size() > 63)
throw std::range_error("label too long");
- string prep(1, (char)label.size());
- prep.append(label);
+ string_t prep(1, (char)label.size());
+ prep.append(label.c_str(), label.size());
d_storage = prep+d_storage;
}
#include <deque>
#include <strings.h>
+// #include <ext/vstring.h>
+
/* Quest in life:
accept escaped ascii presentations of DNS names and store them "natively"
accept a DNS packet with an offset, and extract a DNS name from it
}
private:
- std::string d_storage;
+ // typedef __gnu_cxx::__sso_string string_t;
+ typedef std::string string_t;
+ string_t d_storage;
static std::string escapeLabel(const std::string& orig);
static std::string unescapeLabel(const std::string& orig);
};