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

Merge branch 'feature/misc-bug-fixes' into 'main'

Fix compile in gcc 11, URI exceptions

See merge request beyondaka/beyond-protocol!50
parents d930579e c7d65054
No related branches found
No related tags found
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