-
Notifications
You must be signed in to change notification settings - Fork 0
Dev #39
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
Dev #39
Conversation
…nown issues and technical debt
… to 'Issues' and adjust references accordingly feat: Enhance config.example.json with structured authentication settings and comments for clarity feat: Implement per-connection RC4 encryption in concurrent_reader and multi_connection modules fix: Adjust tunnel runner to utilize per-connection encryption and simplify DHCP handling
…fers, improving memory management and thread safety
- Created `packet_processor.rs` to consolidate common packet processing functions for both Unix and Windows platforms, reducing code duplication by approximately 200 lines. - Implemented functions for building Ethernet frames, sending keepalive packets, and handling ARP replies. - Updated `single_conn.rs` to utilize the new shared packet processing functions, streamlining the data loop for both Unix and Windows.
…management to reduce allocation overhead and improve performance
…ng improvements; update iOS FFI error handling
…rmance and reduced allocations
…fer management in data loop
refactor: Remove unnecessary whitespace in run_packet_loop for cleaner code
…er memory management
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.
Pull request overview
This pull request implements a comprehensive refactoring and improvement of the SoftEther VPN Rust client, focusing on code organization, documentation clarity, and correctness. The main changes restructure the tunnel module for better maintainability, enhance error handling throughout the FFI layer, and improve the configuration system.
Changes:
- Split large tunnel/runner.rs (2219 lines) into 5 focused modules with single responsibilities
- Implemented per-connection RC4 encryption with independent cipher states for multi-connection mode
- Added buffer pooling in ConcurrentReader to reduce allocation overhead
- Enhanced FFI error handling with thread-local error messages and improved iOS API safety
- Restructured config.example.json with nested auth object and comprehensive inline documentation
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/tunnel/runner.rs | Core TunnelRunner reduced from 2219 to 329 lines by extracting data loops |
| src/tunnel/single_conn.rs | New module (695 lines) for single-connection data loop (Unix + Windows) |
| src/tunnel/multi_conn.rs | New module (661 lines) for multi-connection half-connection mode |
| src/tunnel/packet_processor.rs | New module (209 lines) with shared packet processing utilities |
| src/tunnel/dhcp_handler.rs | New module (384 lines) for DHCP handling logic |
| src/tunnel/mod.rs | Updated module declarations with platform-specific conditional compilation |
| src/client/multi_connection.rs | Added per-connection encryption, load balancing, and 522 lines of tests |
| src/client/concurrent_reader.rs | Implemented BufferPool for zero-copy buffer recycling with 387 lines of tests |
| src/client/connection.rs | Fixed 4 unwrap() calls with proper error handling |
| src/protocol/auth.rs | Deduplicated 106 lines by extracting add_client_fields() |
| src/protocol/tunnel.rs | Changed to zero-copy split_to().freeze() |
| src/ffi/client.rs | Added thread-local error storage, removed verbose logging prefixes |
| src/ffi/ios.rs | Changed APIs to caller-provided buffers (thread-safety improvement) |
| src/ffi/android.rs | Enhanced JNI with full session data and error message support |
| include/SoftEtherVPN.h | Added softether_get_last_error() and softether_clear_last_error() |
| examples/ios/SoftEtherBridge.swift | Added originalServerIP field and improved error messages |
| config.example.json | Restructured with nested auth object and comprehensive comments |
| README.md | Visual refinement of ASCII architecture diagram |
| ISSUES.md | Complete rewrite as detailed technical debt and issue tracker |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces significant improvements to documentation, configuration, and code structure, with a focus on clarity, maintainability, and correctness. The main changes include a comprehensive rewrite of the
ISSUES.mdto provide a detailed technical debt and issue tracker, major enhancements to the example configuration file for better usability and future-proofing, and a minor update to the iOS bridge API. Additionally, the architecture diagram in theREADME.mdhas been visually refined for clarity.Documentation and Issue Tracking Improvements
ISSUES.mdto provide a detailed, categorized issue tracker, including technical debt, performance issues, missing features, architectural notes, and recent fixes. This document now serves as the central place for tracking all known issues and technical debt, with clear instructions for contributors.Configuration File Enhancements
config.example.jsonnow uses a nestedauthobject for authentication configuration, supports multiple authentication methods, and includes extensive inline comments for each section. TLS, tunnel, session, and performance settings are grouped and documented for clarity.static_ipfield is nownullby default, with the option to provide a full object when static IP is needed. Redundant fields and duplicate settings have been removed.API and Architecture Updates
SoftEtherBridge.Sessionstruct in the iOS example now exposes a new fieldoriginalServerIPfor improved diagnostics and feature parity.README.mdis visually refined for better readability, with consistent box widths and improved alignment. [1] [2]These changes collectively improve developer experience, code maintainability, and the clarity of both documentation and configuration for future development.