File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ FDv2ProtocolHandler::Result FDv2ProtocolHandler::HandleServerIntent(
120120 }
121121 auto const & intent = **result;
122122 if (intent.payloads .empty ()) {
123+ // The protocol requires exactly one payload per server-intent, so
124+ // an empty payloads array is a spec violation. Reset to avoid
125+ // leaking accumulated state from a prior incomplete transfer.
126+ Reset ();
123127 return std::monostate{};
124128 }
125129 // The protocol defines exactly one payload per intent.
@@ -242,6 +246,8 @@ FDv2ProtocolHandler::Result FDv2ProtocolHandler::HandleGoodbye(
242246 auto result =
243247 boost::json::value_to<tl::expected<std::optional<Goodbye>, JsonError>>(
244248 data);
249+ // Parse failures are intentionally ignored: the caller should rotate
250+ // sources regardless of whether the reason field is readable.
245251 if (!result) {
246252 return Goodbye{std::nullopt };
247253 }
You can’t perform that action at this time.
0 commit comments