feat: add error packet handling.#61
Merged
Romero027 merged 1 commit intoappnet-org:mainfrom Jan 22, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances error packet handling in both the proxy and proxy-buffer components, ensuring error packets are correctly detected, processed, forwarded, and tested. The changes introduce a dedicated method for error packet processing, improve routing information propagation, and add comprehensive tests for error packet serialization, deserialization, and validation.
Error Packet Handling Improvements:
ProcessErrorPacketmethod toPacketBufferin bothcmd/proxy/buffer.goandcmd/proxy-buffer/buffer.go, enabling direct processing and forwarding of error packets without fragmentation. This method constructs aBufferedPacketwith full routing information. [1] [2]handlePacketlogic in bothcmd/proxy/main.goandcmd/proxy-buffer/main.goto detect error packets by their type ID, process them using the new method, and forward them directly to the intended peer, bypassing the element chain. [1] [2]Error Packet Routing and Serialization:
SendErrorPacketincmd/proxy/util/send_packet.goandcmd/proxy-buffer/util/send_packet.goto include source and destination IP/port fields in error packets, ensuring accurate routing information is preserved and transmitted.SendErrorPacketto pass the new routing parameters. [1] [2]Testing Enhancements:
cmd/proxy/main_test.goandcmd/proxy/buffer_test.go. These tests verify correct field propagation, error detection, and boundary conditions. [1] [2]Other Changes:
cmd/proxy/main.goto aid in development and troubleshooting.packetpackage where required. [1] [2]These changes collectively improve the reliability and observability of error handling in the proxy system, ensuring error packets are robustly managed and tested.