diff --git a/src/client.cpp b/src/client.cpp index 31bc702..e0b9934 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -580,7 +580,7 @@ void procSearchReply(ContextImpl& self, const SockAddr& src, Buffer& M, bool ist uint16_t port = 0; uint8_t found = 0u; - _from_wire<12>(M, &guid[0], false); + _from_wire<12>(M, &guid[0], false, __FILE__, __LINE__); // searchSequenceID // we don't use this and instead rely on ID for individual PVs M.skip(4u, __FILE__, __LINE__); diff --git a/src/pvaproto.h b/src/pvaproto.h index 5d02e9c..a865487 100644 --- a/src/pvaproto.h +++ b/src/pvaproto.h @@ -160,10 +160,10 @@ public: // assumes prior buf.ensure(M) where M>=N template -inline void _to_wire(Buffer& buf, const uint8_t *mem, bool reverse) +inline void _to_wire(Buffer& buf, const uint8_t *mem, bool reverse, const char *fname, int lineno) { if(!buf.ensure(N)) { - buf.fault(__FILE__, __LINE__); + buf.fault(fname, lineno); return; } else if(reverse) { @@ -180,10 +180,10 @@ inline void _to_wire(Buffer& buf, const uint8_t *mem, bool reverse) } template -inline void _from_wire(Buffer& buf, uint8_t *mem, bool reverse) +inline void _from_wire(Buffer& buf, uint8_t *mem, bool reverse, const char *fname, int lineno) { if(!buf.ensure(N)) { - buf.fault(__FILE__, __LINE__); + buf.fault(fname, lineno); return; } else if(reverse) { @@ -212,7 +212,7 @@ inline void to_wire(Buffer& buf, const T& val) uint8_t b[sizeof(T)]; } pun; pun.v = val; - _to_wire(buf, pun.b, buf.be ^ hostBE); + _to_wire(buf, pun.b, buf.be ^ hostBE, __FILE__, __LINE__); } template::value, int>::type =0> @@ -238,7 +238,7 @@ inline void from_wire(Buffer& buf, T& val) T v; uint8_t b[sizeof(T)]; } pun; - _from_wire(buf, pun.b, buf.be ^ hostBE); + _from_wire(buf, pun.b, buf.be ^ hostBE, __FILE__, __LINE__); if(buf.good()) val = pun.v; } diff --git a/src/server.cpp b/src/server.cpp index f7c9ecd..49ae935 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -628,7 +628,7 @@ void Server::Pvt::onSearch(const UDPManager::Search& msg) M.skip(8, __FILE__, __LINE__); // fill in header after body length known - _to_wire<12>(M, effective.guid.data(), false); + _to_wire<12>(M, effective.guid.data(), false, __FILE__, __LINE__); to_wire(M, msg.searchID); to_wire(M, SockAddr::any(AF_INET)); to_wire(M, uint16_t(effective.tcp_port)); @@ -661,7 +661,7 @@ void Server::Pvt::doBeacons(short evt) VectorOutBuf M(true, beaconMsg); M.skip(8, __FILE__, __LINE__); // fill in header after body length known - _to_wire<12>(M, effective.guid.data(), false); + _to_wire<12>(M, effective.guid.data(), false, __FILE__, __LINE__); to_wire(M, uint8_t(0u)); // flags (aka. QoS, aka. undefined) to_wire(M, uint8_t(beaconSeq++)); // sequence to_wire(M, uint16_t(beaconChange));// change count diff --git a/src/serverchan.cpp b/src/serverchan.cpp index e81a30a..91381bd 100644 --- a/src/serverchan.cpp +++ b/src/serverchan.cpp @@ -237,7 +237,7 @@ void ServerConn::handle_SEARCH() EvOutBuf R(hostBE, txBody.get()); - _to_wire<12>(R, iface->server->effective.guid.data(), false); + _to_wire<12>(R, iface->server->effective.guid.data(), false, __FILE__, __LINE__); to_wire(R, searchID); to_wire(R, SockAddr::any(AF_INET)); to_wire(R, iface->bind_addr.port()); diff --git a/src/udp_collector.cpp b/src/udp_collector.cpp index 0be48b9..2aa3e18 100644 --- a/src/udp_collector.cpp +++ b/src/udp_collector.cpp @@ -187,7 +187,7 @@ struct UDPCollector : public UDPManager::Search, case CMD_BEACON: { uint16_t port = 0; - _from_wire<12>(M, &beaconMsg.guid[0], false); + _from_wire<12>(M, &beaconMsg.guid[0], false, __FILE__, __LINE__); M.skip(4, __FILE__, __LINE__); // skip flags, seq, and change count. unused from_wire(M, beaconMsg.server); from_wire(M, port);