Implement network switching improvements for HMAC file server

- Added support for chunked and resumable uploads to enhance resilience against network interruptions.
- Introduced a new upload session management system to track progress and handle retries.
- Enhanced connection management with improved timeout settings for mobile networks.
- Implemented network change detection and handling to pause and resume uploads seamlessly.
- Developed client-side retry logic for uploads to improve reliability.
- Updated configuration options to enable new features and set recommended defaults for timeouts and chunk sizes.
- Created integration layer to add new features without modifying existing core functionality.
- Established a network resilience manager to monitor network changes and manage active uploads.
This commit is contained in:
2025-07-17 18:00:14 +02:00
parent 71a73bc514
commit 6a90fa6e30
8 changed files with 1553 additions and 1 deletions

View File

@ -140,7 +140,8 @@ type UploadsConfig struct {
ChunkedUploadsEnabled bool `toml:"chunkeduploadsenabled" mapstructure:"chunkeduploadsenabled"`
ChunkSize string `toml:"chunksize" mapstructure:"chunksize"`
ResumableUploadsEnabled bool `toml:"resumableuploadsenabled" mapstructure:"resumableuploadsenabled"`
MaxResumableAge string `toml:"max_resumable_age" mapstructure:"max_resumable_age"`
SessionTimeout string `toml:"sessiontimeout" mapstructure:"sessiontimeout"`
MaxRetries int `toml:"maxretries" mapstructure:"maxretries"`
}
type DownloadsConfig struct {
@ -760,6 +761,9 @@ func main() {
}
log.Infof("Running version: %s", versionString)
// Initialize network resilience features (non-intrusive)
InitializeEnhancements()
log.Infof("Starting HMAC file server %s...", versionString)
if conf.Server.UnixSocket {
socketPath := "/tmp/hmac-file-server.sock" // Use a default socket path since ListenAddress is now a port