Widen speed limit types from uint16 to uint32 - #436
Merged
Conversation
The upload/download speed limits (s_maxupload, s_maxdownload) and slot allocation (s_slotallocation) were stored as uint16, capping configurable speed to 65534 kB/s (~524 Mbps) since 65535 is treated as unlimited. This is inadequate for modern gigabit+ connections. Changes: Preferences.h / Preferences.cpp: - Change s_maxupload, s_maxdownload, s_slotallocation from uint16 to uint32, along with their getters and setters - The existing backwards compatibility check in CheckUlDlRatio() that maps 0xFFFF to UNLIMITED still works correctly with uint32 UploadQueue.h / UploadQueue.cpp: - Change GetMaxSlots() return type and local variables from uint16 to uint32 to prevent truncation when calculating slot counts from large speed values RemoteConnect.h: - Update SetPreferencesConnections() parameter types for MaxDownloadSpeed, MaxUploadSpeed, and UploadSlotAllocation from uint16 to uint32 EC protocol note: - EC tags EC_TAG_CONN_MAX_UL, EC_TAG_CONN_MAX_DL, and EC_TAG_CONN_SLOT_ALLOCATION now carry uint32 values. EC clients reading these tags should use GetInt() which handles any integer size. Clients sending these tags should encode them as 32-bit.
Contributor
|
There is a documentation for the EC protocol. Maybe is great to add this change to the doc in order to keep it current. |
Add Section 4 with a tag type reference for EC_TAG_PREFS_CONNECTIONS subtags, noting that EC_TAG_CONN_MAX_DL, EC_TAG_CONN_MAX_UL, and EC_TAG_CONN_SLOT_ALLOCATION were widened from uint16 to uint32. Requested by reviewer on PR#436.
Contributor
Author
|
Good call, thank you! Added a new Section 4: Notable Tag Types to |
got3nks
added a commit
to got3nks/amule
that referenced
this pull request
Apr 23, 2026
Two small UI fixes on the Preferences dialog: 1. **Bandwidth spin caps: 19375 kB/s → 1000000 kB/s** The four bandwidth spin controls in src/muuli_wdr.cpp were still capped at 19375 kB/s (~155 Mbit/s), a floor from the pre- gigabit-Ethernet era. Users on gigabit or multi-gig links saw the value silently clamp when they typed anything higher. amule-project#436 has already widened MaxUpload / MaxDownload prefs to uint32, and the upload throttler's bytesToSpend arithmetic (sint32 accumulator ticking at ~1 kHz) still has ~2 seconds of headroom before overflow at 1 GB/s, so 1000000 is a safe modern ceiling. Fields touched: IDC_MAXDOWN, IDC_MAXUP — Connection page IDC_DOWNLOAD_CAP, IDC_UPLOAD_CAP — Statistics graph scale 2. **wxSpinCtrl width: hardcoded wxSize(100,-1) → wxDefaultSize** On GTK 3 (and likely other modern themes) the hardcoded 100 px width is too narrow for wxSpinCtrl to render both spin buttons when the value field contains 5+ digits. The + button ends up clipped / cut off visually on the Connection, Security and other prefs pages. wxDefaultSize lets wx compute a width that fits the text + both buttons based on theme font metrics. 16 spin controls updated; the few narrower ones (wxSize(40,-1), wxSize(45,-1), wxSize(60,-1) for single- or few-digit fields) are intentionally left alone.
got3nks
added a commit
to got3nks/amule
that referenced
this pull request
Apr 23, 2026
Two small UI fixes on the Preferences dialog: 1. **Bandwidth spin caps: 19375 kB/s → 1000000 kB/s** The four bandwidth spin controls in src/muuli_wdr.cpp were still capped at 19375 kB/s (~155 Mbit/s), a floor from the pre- gigabit-Ethernet era. Users on gigabit or multi-gig links saw the value silently clamp when they typed anything higher. amule-project#436 has already widened MaxUpload / MaxDownload prefs to uint32, and the upload throttler's bytesToSpend arithmetic (sint32 accumulator ticking at ~1 kHz) still has ~2 seconds of headroom before overflow at 1 GB/s, so 1000000 is a safe modern ceiling. Fields touched: IDC_MAXDOWN, IDC_MAXUP — Connection page IDC_DOWNLOAD_CAP, IDC_UPLOAD_CAP — Statistics graph scale 2. **wxSpinCtrl width: hardcoded wxSize(100,-1) → wxDefaultSize** On GTK 3 (and likely other modern themes) the hardcoded 100 px width is too narrow for wxSpinCtrl to render both spin buttons when the value field contains 5+ digits. The + button ends up clipped / cut off visually on the Connection, Security and other prefs pages. wxDefaultSize lets wx compute a width that fits the text + both buttons based on theme font metrics. 16 spin controls updated; the few narrower ones (wxSize(40,-1), wxSize(45,-1), wxSize(60,-1) for single- or few-digit fields) are intentionally left alone.
got3nks
added a commit
to got3nks/amule
that referenced
this pull request
Apr 23, 2026
Two small UI fixes on the Preferences dialog: 1. **Bandwidth spin caps: 19375 kB/s → 1000000 kB/s** The four bandwidth spin controls in src/muuli_wdr.cpp were still capped at 19375 kB/s (~155 Mbit/s), a floor from the pre- gigabit-Ethernet era. Users on gigabit or multi-gig links saw the value silently clamp when they typed anything higher. amule-project#436 has already widened MaxUpload / MaxDownload prefs to uint32, and the upload throttler's bytesToSpend arithmetic (sint32 accumulator ticking at ~1 kHz) still has ~2 seconds of headroom before overflow at 1 GB/s, so 1000000 is a safe modern ceiling. Fields touched: IDC_MAXDOWN, IDC_MAXUP — Connection page IDC_DOWNLOAD_CAP, IDC_UPLOAD_CAP — Statistics graph scale 2. **wxSpinCtrl width: hardcoded wxSize(100,-1) → wxDefaultSize** On GTK 3 (and likely other modern themes) the hardcoded 100 px width is too narrow for wxSpinCtrl to render both spin buttons when the value field contains 5+ digits. The + button ends up clipped / cut off visually on the Connection, Security and other prefs pages. wxDefaultSize lets wx compute a width that fits the text + both buttons based on theme font metrics. 16 spin controls updated; the few narrower ones (wxSize(40,-1), wxSize(45,-1), wxSize(60,-1) for single- or few-digit fields) are intentionally left alone.
got3nks
added a commit
to got3nks/amule
that referenced
this pull request
Apr 23, 2026
Two small UI fixes on the Preferences dialog: 1. **Bandwidth spin caps: 19375 kB/s → 1000000 kB/s** The four bandwidth spin controls in src/muuli_wdr.cpp were still capped at 19375 kB/s (~155 Mbit/s), a floor from the pre- gigabit-Ethernet era. Users on gigabit or multi-gig links saw the value silently clamp when they typed anything higher. amule-project#436 has already widened MaxUpload / MaxDownload prefs to uint32, and the upload throttler's bytesToSpend arithmetic (sint32 accumulator ticking at ~1 kHz) still has ~2 seconds of headroom before overflow at 1 GB/s, so 1000000 is a safe modern ceiling. Fields touched: IDC_MAXDOWN, IDC_MAXUP — Connection page IDC_DOWNLOAD_CAP, IDC_UPLOAD_CAP — Statistics graph scale 2. **wxSpinCtrl width: hardcoded wxSize(100,-1) → wxDefaultSize** On GTK 3 (and likely other modern themes) the hardcoded 100 px width is too narrow for wxSpinCtrl to render both spin buttons when the value field contains 5+ digits. The + button ends up clipped / cut off visually on the Connection, Security and other prefs pages. wxDefaultSize lets wx compute a width that fits the text + both buttons based on theme font metrics. 16 spin controls updated; the few narrower ones (wxSize(40,-1), wxSize(45,-1), wxSize(60,-1) for single- or few-digit fields) are intentionally left alone.
got3nks
added a commit
to got3nks/amule
that referenced
this pull request
Apr 23, 2026
Two small UI fixes on the Preferences dialog: 1. **Bandwidth spin caps: 19375 kB/s → 1000000 kB/s** The four bandwidth spin controls in src/muuli_wdr.cpp were still capped at 19375 kB/s (~155 Mbit/s), a floor from the pre- gigabit-Ethernet era. Users on gigabit or multi-gig links saw the value silently clamp when they typed anything higher. amule-project#436 has already widened MaxUpload / MaxDownload prefs to uint32, and the upload throttler's bytesToSpend arithmetic (sint32 accumulator ticking at ~1 kHz) still has ~2 seconds of headroom before overflow at 1 GB/s, so 1000000 is a safe modern ceiling. Fields touched: IDC_MAXDOWN, IDC_MAXUP — Connection page IDC_DOWNLOAD_CAP, IDC_UPLOAD_CAP — Statistics graph scale 2. **wxSpinCtrl width: hardcoded wxSize(100,-1) → wxDefaultSize** On GTK 3 (and likely other modern themes) the hardcoded 100 px width is too narrow for wxSpinCtrl to render both spin buttons when the value field contains 5+ digits. The + button ends up clipped / cut off visually on the Connection, Security and other prefs pages. wxDefaultSize lets wx compute a width that fits the text + both buttons based on theme font metrics. 16 spin controls updated; the few narrower ones (wxSize(40,-1), wxSize(45,-1), wxSize(60,-1) for single- or few-digit fields) are intentionally left alone.
got3nks
added a commit
to got3nks/amule
that referenced
this pull request
Apr 23, 2026
Three small UI fixes on the Preferences dialog. 1. **Bandwidth spin caps raised from 19375 kB/s to 1,000,000 kB/s.** The bandwidth spin controls in src/muuli_wdr.cpp were capped at 19375 kB/s (~155 Mbit/s), a floor from the pre-gigabit-Ethernet era. Users on gigabit or multi-gig links saw the value silently clamp when they typed anything higher. amule-project#436 has already widened MaxUpload / MaxDownload prefs to uint32, and the upload throttler's bytesToSpend arithmetic (sint32 accumulator ticking at ~1 kHz) still has ~2 seconds of headroom before overflow at 1 GB/s, so 1,000,000 is a safe modern ceiling. Fields touched: IDC_MAXDOWN, IDC_MAXUP — Connection page IDC_DOWNLOAD_CAP, IDC_UPLOAD_CAP — Statistics graph scale 2. **Slot Allocation spin cap raised from 100 to 100,000 kB/s.** Previously artificially pinned to 100 even though the underlying pref has always been uint32 (Preferences.h s_slotallocation / GetSlotAllocation). With MaxUpload now at 1,000,000, the per-slot reservation needs matching headroom. 100,000 = 1/10 of the new upload ceiling keeps the upload ratio sensible: below that the slot-count formula (MaxUpload / SlotAllocation) can still grow, above it MIN_UP_CLIENTS_ALLOWED=2 takes over and the knob stops being useful anyway. Field touched: IDC_SLOTALLOC (Connection page). 3. **Spin control widths: hardcoded wxSize(100,-1) fixed up so +/- buttons render without clipping on GTK 3 and other modern themes.** The hardcoded 100 px was too narrow for wxSpinCtrl to render both spin buttons when the value field holds 5+ digits; the + button ends up clipped on the Connection, Security and other prefs pages. - The three bandwidth fields on the Connection page (Download, Upload, Slot Allocation) use wxSize(140,-1) so they are visually aligned at the same width regardless of typed digit count. - The remaining 13 wider spin controls (ports, max sources, max connections, disk-space minimum, web-config ports, graph scales, MaxConnections5sec) switch to wxDefaultSize and let wx compute a width that fits the text + both buttons from theme metrics. - The few narrower fields (wxSize(40,-1), wxSize(45,-1), wxSize(60,-1) for single- or few-digit values like retry counts) are intentionally left alone.
mrjimenez
pushed a commit
that referenced
this pull request
Apr 23, 2026
Three small UI fixes on the Preferences dialog. 1. **Bandwidth spin caps raised from 19375 kB/s to 1,000,000 kB/s.** The bandwidth spin controls in src/muuli_wdr.cpp were capped at 19375 kB/s (~155 Mbit/s), a floor from the pre-gigabit-Ethernet era. Users on gigabit or multi-gig links saw the value silently clamp when they typed anything higher. #436 has already widened MaxUpload / MaxDownload prefs to uint32, and the upload throttler's bytesToSpend arithmetic (sint32 accumulator ticking at ~1 kHz) still has ~2 seconds of headroom before overflow at 1 GB/s, so 1,000,000 is a safe modern ceiling. Fields touched: IDC_MAXDOWN, IDC_MAXUP — Connection page IDC_DOWNLOAD_CAP, IDC_UPLOAD_CAP — Statistics graph scale 2. **Slot Allocation spin cap raised from 100 to 100,000 kB/s.** Previously artificially pinned to 100 even though the underlying pref has always been uint32 (Preferences.h s_slotallocation / GetSlotAllocation). With MaxUpload now at 1,000,000, the per-slot reservation needs matching headroom. 100,000 = 1/10 of the new upload ceiling keeps the upload ratio sensible: below that the slot-count formula (MaxUpload / SlotAllocation) can still grow, above it MIN_UP_CLIENTS_ALLOWED=2 takes over and the knob stops being useful anyway. Field touched: IDC_SLOTALLOC (Connection page). 3. **Spin control widths: hardcoded wxSize(100,-1) fixed up so +/- buttons render without clipping on GTK 3 and other modern themes.** The hardcoded 100 px was too narrow for wxSpinCtrl to render both spin buttons when the value field holds 5+ digits; the + button ends up clipped on the Connection, Security and other prefs pages. - The three bandwidth fields on the Connection page (Download, Upload, Slot Allocation) use wxSize(140,-1) so they are visually aligned at the same width regardless of typed digit count. - The remaining 13 wider spin controls (ports, max sources, max connections, disk-space minimum, web-config ports, graph scales, MaxConnections5sec) switch to wxDefaultSize and let wx compute a width that fits the text + both buttons from theme metrics. - The few narrower fields (wxSize(40,-1), wxSize(45,-1), wxSize(60,-1) for single- or few-digit values like retry counts) are intentionally left alone.
got3nks
added a commit
to got3nks/amule
that referenced
this pull request
Jul 11, 2026
…tails (amule-project#418) (amule-project#436) * feat(amuleapi): audio/video media metadata over EC + REST + File Details (amule-project#418) Part 1 (amuled/EC): six new EC_TAG_KNOWNFILE_MEDIA_* tag codes (0x0410-0x0415, added to ECCodes.h + .abstract + name switch), emitted in the CEC_SharedFile_Tag base ctor from FT_MEDIA_* and guarded by GetMetaDataVer() != 0 so non-media files add no tags. Both /shared and /downloads (partfiles) carry them via the shared base ctor. Part 2 (webapi): decode into a FileSnapshot media sub-struct (has_media gate); emit an inline `media` object {length_s,bitrate,codec,artist, album,title} on GET /downloads/{hash} and GET /shared/{hash}, omitted entirely when the file has no probed metadata. Part 3 (GUI): a new 'Media Info' box in the File Details dialog (fileDetails() + IDC_FD_MEDIA_* ids), populated in CFileDetailDialog::UpdateData() from FT_MEDIA_*; amulegui decodes the Part-1 EC tags into the proxy file via AddTagUnique so the identical GetIntTagValue/GetStrTagValue/GetMetaDataVer calls work in both builds. Layout + styling mirror the ICH box. Reuses existing translatable strings (Length:/Bitrate:/Codec:/Artist:/Album:/Title:/Media Info/N/A) — no new strings, no catalog regen. RefresherTest gains a media decode case; curl 04 asserts media is omitted for unprobed files; REST reference documents the media object. * i18n: regenerate app catalogs for the Media Info box strings (amule-project#418) New translatable strings from the File Details Media Info box: "Media Info", "Length :", "Bitrate :", "Codec :", "Artist :", "Album :" ("Title :" already existed). App catalog only (scripts/update-po.sh); manpage/po4a catalogs untouched.
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.
Summary
The upload/download speed limits (
s_maxupload,s_maxdownload) and slot allocation (s_slotallocation) are stored asuint16, capping the configurable speed to 65534 kB/s (~524 Mbps) since 65535 is treated as unlimited. This is inadequate for modern gigabit+ connections.s_maxupload,s_maxdownload,s_slotallocationfromuint16touint32inPreferences.h/Preferences.cpp, along with their getters and settersGetMaxSlots()return type and local variables fromuint16touint32to prevent truncation when calculating slot counts from large speed valuesSetPreferencesConnections()parameter types inRemoteConnect.hBackward compatibility
CheckUlDlRatio()that maps0xFFFFtoUNLIMITEDstill works correctly withuint32MkCfg_Intis templated and handlesuint32without changesMAX_UP_CLIENTS_ALLOWEDremains at 250 (unchanged)EC protocol note
EC tags
EC_TAG_CONN_MAX_UL,EC_TAG_CONN_MAX_DL, andEC_TAG_CONN_SLOT_ALLOCATIONnow carryuint32values. TheApply()method usesoneTag->GetInt()which handles any integer size. EC clients sending these tags should encode them as 32-bit integers.Files changed
src/Preferences.hsrc/Preferences.cppsrc/UploadQueue.hGetMaxSlots()return typesrc/UploadQueue.cppGetMaxSlots()implementation + local varssrc/libs/ec/cpp/RemoteConnect.h