JoelKatz

Debug endpoint mismatches

Jul 28th, 2014
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.48 KB | None | 0 0
  1. diff --git a/src/ripple/peerfinder/impl/Logic.h b/src/ripple/peerfinder/impl/Logic.h
  2. index 812e5d2..88dd5c9 100644
  3. --- a/src/ripple/peerfinder/impl/Logic.h
  4. +++ b/src/ripple/peerfinder/impl/Logic.h
  5. @@ -280,6 +280,22 @@ public:
  6.              if (iter != state->slots.end ())
  7.              {
  8.                  Slot::ptr const& self (iter->second);
  9. +                if ((self->local_endpoint () != boost::none) &&
  10. +                    (self->local_endpoint () != remote_endpoint))
  11. +                {
  12. +                    // This is most odd. We have received an incoming connection,
  13. +                    // and we have its local endpoint in our slot table.
  14. +                    // So we expect that we have two ends of the same connection.
  15. +                    // Yet our remote endpoint does not match the other connection's
  16. +                    // local endpoint.
  17. +                    m_journal.fatal << "Local endpoint mismatch:";
  18. +                    m_journal.fatal <<
  19. +                        "1) local:" << local_endpoint <<
  20. +                        " remote:" << remote_endpoint;
  21. +                    m_journal.fatal <<
  22. +                        "2) local:" << self->local_endpoint () <<
  23. +                        " remote:" << self->remote_endpoint ();
  24. +                }
  25.                  assert ((self->local_endpoint () == boost::none) ||
  26.                      (self->local_endpoint () == remote_endpoint));
  27.                  if (m_journal.warning) m_journal.warning << beast::leftw (18) <<
Advertisement
Add Comment
Please, Sign In to add comment