Skip to content
Snippets Groups Projects
Commit c7d65054 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fix compile in gcc 11, URI exceptions

parent d930579e
Branches
Tags
No related merge requests found
......@@ -6,7 +6,9 @@
template <typename T>
void ftl::codec::pack(const T &v, std::vector<uint8_t> &out) {
out.resize(0);
// Note: The following breaks in gcc 11 and 12.
//out.resize(0);
//out.reserve(1024);
ftl::util::FTLVectorBuffer buf(out);
msgpack::pack(buf, v);
}
......
......@@ -22,6 +22,7 @@ Muxer::~Muxer() {
se.handle.cancel();
se.req_handle.cancel();
se.avail_handle.cancel();
se.err_handle.cancel();
}
}
......
......@@ -38,7 +38,7 @@ static const std::unordered_map<std::string, ftl::URI::scheme_t> schemeMap = {
{"device", URI::SCHEME_DEVICE},
{"file", URI::SCHEME_FILE},
{"group", URI::SCHEME_GROUP},
{"beyond", URI::SCHEME_TCP},
{"beyond", URI::SCHEME_BEYOND},
{"mux", URI::SCHEME_MUX},
{"mirror", URI::SCHEME_MIRROR},
{"cast", URI::SCHEME_CAST}
......@@ -136,7 +136,7 @@ void URI::_parse(uri_t puri) {
std::string porttext = std::string(uri.portText.first, uri.portText.afterLast - uri.portText.first);
try {
m_port = std::stoi(porttext);
m_port = (porttext.size() > 0) ? std::stoi(porttext) : 0;
if (m_port < 0 || m_port >= 65535) {
throw FTL_Error("Port out of range");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment