Repository navigation
AirDrop receiver: compatibility and reliability fixes measured on real macOS - #20
Conversation
There was a problem hiding this comment.
Thanks for the contributions!
Two of your commits carry my GitHub attribution. Since my follow-up PR (#33) replaces the timeout commit, and the restart change is on hold until the answers below, the simplest fix is to drop 38516e7 and c7ec343 from this branch. That leaves IsAirDropable and the captured media table, which I've tested: a photo shared from Photos now arrives as the original HEIC instead of a JPEG.
The timeout and restart changes need a different approach:
- Upload wait.
READ_IDLE_TIMEOUT_SECONDScovers every socket read, andINITIAL_READ_SECONDSonly starts during the body, so neither one targets the wait between Ask and Upload. I've addedUPLOAD_WAIT_SECONDSin a separate PR, #33. It applies only between an accepted file Ask and the start of the next request. Every other read keeps the 30 s limit, and the wait gets its own log line. Its test sends the Upload after the old 30 s limit. - Restart after a driver reload. Correction to what I wrote earlier: the receiver listens on the wildcard address, not on awdl0's address, so it keeps running through a reload and accepts connections on the new awdl0. A receiver that stayed down must have exited or been stopped, which the questions below should show. I'll hold the restart change until then.
Two things from your side would help:
- Re-measure the Ask -> Upload gap with omdrop-awdl#23, which is now merged. A cut-off service record makes the Mac drop the receiver, which could explain the gap. Across 19 transfers on a BCM4387, the Upload started within 1.5 s of the Ask.
- What happened to the receiver during the reload where it stayed down? A few facts would settle it:
- Did the receiver process exit, or keep running? If it exited, how (systemd's "Main process exited" line gives the exit status or signal), and how long after the driver was unloaded?
- Did systemd log a stop request for the unit, or a restart attempt?
- While it was down, was anything listening on port 8771 (
ss -ltnp)?
The answers to these would direct the appropriate fix. Many thanks!
| # tripping and leave the unit failed afterwards; 30 in 300 s rides out the | ||
| # reload and still stops a genuine crash loop. | ||
| StartLimitIntervalSec=300 | ||
| StartLimitBurst=30 |
There was a problem hiding this comment.
This no longer applies once c7ec343 is dropped. If a restart change turns out to be needed, both start-limit settings belong in [Unit]: StartLimitIntervalSec is ignored under [Service], and StartLimitBurst is only accepted there as a compatibility alias.
| READ_IDLE_TIMEOUT_SECONDS = 30 | ||
| INITIAL_READ_SECONDS = 60 | ||
| READ_IDLE_TIMEOUT_SECONDS = 120 | ||
| INITIAL_READ_SECONDS = 120 |
There was a problem hiding this comment.
This no longer applies once 38516e7 is dropped; #33 adds a scoped UPLOAD_WAIT_SECONDS instead. For context: READ_IDLE_TIMEOUT_SECONDS applies to all socket operations, so raising it also lets stalled upload bodies hold an upload slot longer. INITIAL_READ_SECONDS controls the cumulative body-progress allowance, and its clock starts during body handling, so increasing it does not extend the Ask → Upload wait.
If longer body tolerance was also intentional, please say so separately and we can look at it on its own.
Retain IsAirDropable in Discover and Ask answers alongside the receiver identity and media capabilities. Update the protocol response contract accordingly.
Replace the Version 1 codec-free stub with the Version 3 table captured from a MacBook Pro response. Preserve the captured Discover and Ask key ordering and update the receiver protocol expectation and capability documentation.
1bb0235 to
5d673f7
Compare
|
Thank you very much for the careful review, the HEIC verification, and the scoped timeout implementation in #33. I apologize for the incorrect attribution and for drawing too strong a conclusion from the earlier reload observation. I have removed 38516e7 and c7ec343, rebased the two retained response changes, and recreated those commits with aleckloiselle as the sole author and committer, without coauthor trailers. There are no timeout or service-unit changes left in this PR. All 9 receiver protocol tests pass on the cleaned branch, including real TLS and Ask-to-Upload storage. I also checked the historical journal. On September 29 (local time, UTC-04:00), systemd explicitly stopped the receiver at 04:58:14. The later driver reload was at 05:11:06, and systemd started the receiver again at 05:14:31. This does not support my earlier claim that the reload killed the receiver: it was already stopped. I do not have a contemporaneous ss snapshot for that interval, so I cannot independently establish whether another process held port 8771 then. I agree that the restart-policy change should be dropped rather than justified by that observation. The installed helper contains the corrected header calculation from omdrop-awdl#23 (total length = 4 + TLV length). A fresh hardware Ask-to-Upload measurement is still pending; I will keep that separate from the local protocol-test results. The timeout proposal was intended to address the wait before Upload, not to request a separate increase in stalled-body tolerance. Thank you again for identifying that distinction. |
brentkearney
left a comment
There was a problem hiding this comment.
Thanks Aleck, LGTM!
manifest.json and VERSION_FALLBACK move to 0.16.0. Since 0.15.1: radio backends other than omdrop-awdl (netmojo-systems#25), the captured media capabilities and IsAirDropable (netmojo-systems#20), a scoped Upload wait (netmojo-systems#33), the Qt 6.12 palette fix (netmojo-systems#42), and hardware-neutral docs and marketplace name (netmojo-systems#43). The driver pin stays at omdrop-awdl 0.9.1, the latest release.
Summary
This PR now retains only the two receiver response changes:
IsAirDropablein Discover and Ask responses.Thank you to @brentkearney for reviewing these changes and confirming that a photo shared from Photos arrives as the original HEIC rather than JPEG.
Review follow-up
Removed
38516e7(broad timeout increases) andc7ec343(restart-policy changes), as requested. The scoped Ask-to-Upload wait is handled separately by #33. No timeout or systemd service changes remain in this PR.The two retained commits have been recreated with aleckloiselle as their sole author and committer, without coauthor trailers. Upstream commits have not been rewritten.
Verification
On the cleaned branch,
python3 -m unittest discover -s tests -p test_receiver_protocol.py -vpasses all 9 tests. These launch the receiver and exercise real TLS handshakes, Discover, and Ask-to-Upload file storage. This is local protocol verification, not a new hardware timing measurement.Fresh Ask-to-Upload timing with the omdrop-awdl#23 service-record fix remains outstanding.