-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ProtocolStart and GracefulClose messages #3839
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ripple/overlay/impl/OverlayImpl.cpp needs an additional include to compile in a non-unity build:
#include <ripple/overlay/impl/InboundHandoff.h>
0661f4a
to
cb45e40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Help me I only have a phone
b8e6bb2
to
ddf1931
Compare
ddf1931
to
3135288
Compare
…on start. Add InboundHandoff class to complete HTTP handshake and instantiate inbound PeerImp. Add GracefulClose message to close a peer connection on an application level error.
the last message is graceful close or if aborted and close flag is set. Don't close right after sending graceful close.
[FOLD] Add required include for non-unity build. Make InboundHandoff non-copiable.
3135288
to
fdcb750
Compare
(notes: changes how servers communicate with each other; Nik will review later) |
@JoelKatz FYI - since this is an area of the code that hasn't been touched in many years, let me know if there is anything that needs to be further tested. @sophiax851 it would be useful to confirm that none of these changes have adverse performance impact. Thank you! |
I'll add an item in our queue to run a comparison test with the 1.12 baseline. @intelliot |
Thank you! This will be included in the next beta. If we find any issues with it, we can revert it as appropriate. |
note: we should check with @nbougalis on whether this should be kept in |
Clean up the peer-to-peer protocol start/close sequences by introducing START_PROTOCOL and GRACEFUL_CLOSE messages, which sync inbound/outbound peer send/receive. The GRACEFUL_CLOSE message differentiates application and link layer failures. * Introduce the `InboundHandoff` class to manage inbound peer instantiation and synchronize the send/receive protocol messages between peers. * Update `OverlayImpl` to utilize the `InboundHandoff` class to manage inbound handshakes. * Update `PeerImp` for improved handling of protocol messages. * Modify the `Message` class for better maintainability. * Introduce P2P protocol version `2.3`.
…PLF#3839)" (XRPLF#4850) This reverts commit 8f89694.
High Level Overview of Change
Add InboundHandoff class to send HTTP response
to the outbound peer and instantiate inbound PeerImp
when the response is sent. The peer then waits for
mtSTART_PROTOCOL message from the connected
outbound peer. When the message is received, the peer starts
sending the protocol messages. This update ensures that
the inbound peer is created once the overlay is established,
eliminating the need for doAccept(). In addition it synchronizes
send/receive protocol messages between the peers on start,
eliminating the need for copying the read buffer into the outbound
peer constructor.
Add mtGRACEFUL_CLOSE message to differentiate application
and link layer failures.
Type of Change