Skip to content

rpc: Simplify handling of fatal Json read errors.

Nick Mathewson requested to merge nickm/arti:ticket_1591 into main

Previously, after determining that an error on an RPC connection was fatal, we would:

  1. Determine whether it was a "clean" close or one that needed to be logged.
  2. In exactly one case (specifically, when the inbound Json stream contained a Value that was not an Object) , we would send back a message to the client.
  3. Exit the connection with Ok() or Err(e).

We no longer do step "2" above.

Additionally, we document:

  • Why it's important to exit immediately on syntax errors.
  • A better way to tolerate non-Object Json Values, if we decide someday to do so.

Closes #1591 (closed).

Merge request reports

Loading