Skip to content

v0.4.1: Update performance#14

Merged
78 merged 18 commits into
mainfrom
perf
Mar 11, 2026
Merged

v0.4.1: Update performance#14
78 merged 18 commits into
mainfrom
perf

Conversation

@78
Copy link
Copy Markdown
Owner

@78 78 commented Mar 11, 2026

This pull request introduces significant improvements to the networking and DMG packaging for the project. The most notable changes are the integration of libuv for cross-platform asynchronous I/O, the addition of new networking modules (DHCP, NAT, ICMP, DNS relay, port forwarding), and a complete overhaul of the macOS DMG creation process for better compatibility and visual polish. There are also improvements to struct packing, byte order handling, and the addition of new helper utilities for networking.

Networking enhancements:

  • Added new networking modules for DHCP, NAT, ICMP, DNS relay, and port forwarding to src/core/net. These expand the core network functionality and enable advanced features such as DNS proxying and guest-to-host communication.
  • Integrated libuv for cross-platform async I/O by updating CMakeLists.txt, linking uv_a in src/core/CMakeLists.txt, and including poll_handle.h and uv.h in net_backend.h. This replaces platform-specific polling and enables unified event handling. [1] [2] [3]
  • Refactored and expanded the NetBackend class to support new async handlers, DNS relay sessions, ICMP relay (with platform-specific implementations), and consolidated teardown helpers.

macOS DMG packaging improvements:

  • Replaced the old shell-based DMG creation with a new styled Python workflow using make-dmg-styled.py and make-dmg-background.py. This produces visually polished DMGs with large icons, drag-and-drop arrow backgrounds, APFS support, and robust Finder view configuration, addressing recent macOS compatibility issues. [1] [2] [3]

Codebase and build system improvements:

  • Improved struct packing and platform compatibility for lwIP by defining LWIP_NO_UNISTD_H and avoiding byte order function redefinitions. [1] [2]
  • Added a new frame_builder.h utility for constructing Ethernet/IP/UDP frames for guest injection.
  • Updated version to 0.4.1 to reflect these major changes.

Minor enhancements:

  • Added WIN32_LEAN_AND_MEAN to Windows includes for faster builds and fewer conflicts.
  • Adjusted TCP MSS and lwIP options for improved performance and compatibility.

Let me know if you want details on any specific area or implementation!

Xiaoxia and others added 18 commits March 11, 2026 04:22
- Added new features to CoreAudioPlayer for improved audio queue management, including handling of empty buffers and reconfiguration signaling.
- Introduced detailed IPC message logging in TenBoxIPC.mm to track command and event data with timestamps for better debugging.
- Updated ClipboardHandler to manage clipboard monitoring more effectively with app state notifications.
- Enhanced keyboard event handling in DisplayView to ensure proper input processing during capture modes.
- Added libuv as a dependency in CMakeLists.txt for cross-platform event loop support.
- Updated net_backend to utilize libuv for socket I/O operations, enhancing network performance and responsiveness.
- Refactored net_backend to remove legacy socket handling code, streamlining the implementation.
- Introduced polling mechanisms for NAT entries and port forwarding connections using libuv.
- Enhanced the VM runtime service to leverage libuv's event loop for improved IPC handling and responsiveness.
- Added DHCP server functionality to intercept and respond to DHCP requests.
- Implemented ICMP relay for handling outgoing ICMP packets via raw sockets.
- Introduced new packet header structures and checksum utilities for raw packet manipulation.
- Enhanced NAT table management with IP rewriting and TCP/UDP data relay capabilities.
- Integrated polling mechanisms for NAT entries and port forwarding connections using libuv.
- Updated CMakeLists.txt to include new source files for DHCP, ICMP, and networking utilities.
- Updated version to 0.4.0 in VERSION and Info.plist to reflect the latest release.
- Ensured consistency across versioning files for improved tracking and deployment.
- Added DNS relay capabilities to the NetBackend, allowing the gateway to act as a DNS server that forwards queries to the host's nameserver.
- Introduced new DnsSession structure to manage DNS query sessions and handle responses.
- Updated net_backend to include logic for intercepting and processing DNS queries.
- Enhanced DHCP implementation to advertise the gateway as the DNS server.
- Included necessary changes in CMakeLists.txt to incorporate new source files for DNS relay functionality.
- Updated PollHandle to track closed state, improving resource management during handle closure.
- Refactored network backend to ensure proper cleanup of NAT entries and DNS sessions, preventing potential memory leaks.
- Replaced `Stop()` with `Close()` for polling mechanisms to align with updated state management.
- Adjusted cleanup logic in `OnCleanupTimer` and `TeardownPortForwards` to ensure all handles are fully detached before destruction.
- Minor adjustments to lwipopts.h for TCP MSS and byte order function definitions.
- Changed port_forwards_ from a vector to a list to ensure stable storage for PfEntry addresses used as libuv callback data.
- Enhanced the logic for adding port forwards to ensure proper initialization of PfEntry structures.
- Updated cleanup mechanisms in OnStopSignal and CleanupStaleEntries to safely detach callbacks before aborting TCP connections, preventing potential re-entrance issues.
- Refactored TeardownPortForwards to utilize a lambda for checking the closure of all polls, ensuring complete cleanup before destruction.
- Added calls to EnableWindow for the parent window in both Create VM and Edit VM dialog procedures to ensure the parent window is re-enabled after dialog closure.
- Removed unnecessary SetForegroundWindow calls to streamline the dialog behavior.
- Added logic to suppress the reverse notification when the window resize is driven by the guest display size, preventing unintended bounce back behavior in the host-to-guest set_size process.
- Bumped latest version to 0.4.0 and updated release date to 2026-03-11.
- Modified download URL and SHA256 hash to reflect the new version.
- Adjusted file size for the Windows platform to 2142208 bytes.
- Refactored the GetHostDnsServer function to utilize GetAdaptersAddresses for better DNS server retrieval.
- Introduced a new AdapterDnsInfo structure to store DNS addresses and their metrics.
- Implemented logic to filter and sort DNS candidates based on operational status and metrics, ensuring the most suitable DNS server is selected.
- Updated version.json to reflect changes in the download URL and SHA256 hash for the latest release.
- Added logic to set the active tab to 1 when the VM connection is successfully established and the display has not been initialized, improving user experience during the connection process.
…ound

- Introduced `make-dmg-background.py` to create a transparent DMG background with a subtle drag-and-drop arrow.
- Added `make-dmg-styled.py` to build a styled DMG with large icons and customized Finder view settings, addressing macOS 26 Tahoe compatibility.
- Updated `make-dmg.sh` to utilize the new Python scripts for DMG creation, enhancing the overall build process.
- Bumped version number to 0.4.1 in VERSION file.
- Added support for user-configured image sources and last selected source in AppSettings.
- Implemented functions to handle effective sources and JSON serialization for new settings.
- Improved error handling in HTTP download functions with detailed error messages.
- Updated UI components to reflect changes in image source management.
- Removed the outdated image source "China Mainland 2" from the image source list.
- Updated version to 0.4.1 in version.json, reflecting recent changes and enhancements.
- Revised release notes to detail improvements in image source management and DNS adjustments.
- Replaced the deprecated image source URL with a mechanism to load user-configured sources from a settings file.
- Implemented functionality to retrieve effective sources, defaulting to a predefined list if no user sources are available.
- Added persistence for the last selected image source using UserDefaults, improving user experience by remembering previous selections.
- Updated the CreateVmDialog to utilize the new effective sources method and manage the last selected source.
- Bumped version number to 0.4.1 in Info.plist, version.json, and appcast.xml.
- Updated release notes to reflect performance optimizations and adjustments in shared folder and port forwarding settings.
- Adjusted minimum macOS version requirement to 15.0 in localization files.
@78 78 changed the title v0.4.0: Update performance v0.4.1: Update performance Mar 11, 2026
@78 78 merged commit 9de139c into main Mar 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant