diff --git a/debian/changelog b/debian/changelog index a4d776b..7457f59 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,11 @@ dump978-fa (7.0~dev) UNRELEASED; urgency=medium * In development + * Treat parse failures as fatal connection errors (a common failure mode is if + dump978/faup978 has been pointed at a 1090 data source; we don't want to + continually spam errors in this case) - -- Eric Tran Fri, 24 Sep 2021 15:35:25 +0000 + -- Oliver Jowett Tue, 02 Nov 2021 12:46:24 +0800 dump978-fa (6.1) stable; urgency=medium diff --git a/socket_input.cc b/socket_input.cc index 6a5e109..64d2006 100644 --- a/socket_input.cc +++ b/socket_input.cc @@ -60,6 +60,9 @@ void RawInput::TryNextEndpoint(const boost::system::error_code &last_error) { void RawInput::ScheduleRead() { auto self(shared_from_this()); + if (!socket_.is_open()) + return; + if (used_ >= readbuf_.size()) { HandleError(boost::asio::error::make_error_code(boost::asio::error::no_buffer_space)); return; @@ -119,7 +122,9 @@ void RawInput::ParseBuffer() { } messages->emplace_back(std::move(*result)); } else { - std::cerr << "warning: failed to parse input line: " << line << std::endl; + std::cerr << "error: failed to parse input line: " << line << std::endl; + HandleError(boost::system::errc::make_error_code(boost::system::errc::protocol_error)); + return; } sol = eol + 1; }