发布 0.4.7 双向并发传输封版
This commit is contained in:
+16
-4
@@ -1,4 +1,4 @@
|
||||
# QFT protocol notes — v0.4.6
|
||||
# QFT protocol notes — v0.4.7
|
||||
|
||||
## 1. Windows → Android optical: QFT2
|
||||
|
||||
@@ -36,7 +36,7 @@ senderLen 2 u16 BE
|
||||
senderDevice N UTF-8
|
||||
```
|
||||
|
||||
### Optical parameters in v0.4.6
|
||||
### Optical parameters in v0.4.7
|
||||
|
||||
- one QR per display frame;
|
||||
- DATA payload: **450 B**;
|
||||
@@ -75,7 +75,7 @@ The overlay is derived from the same ROI used by the decoder, so the green/yello
|
||||
|
||||
Discovery order includes QR hint, UDP `QFTDISC2`, gateway/direct candidates and bounded current-subnet fallback.
|
||||
|
||||
## 4. Android → Windows upload
|
||||
## 4. 扫码本地直传(Android ↔ Windows)
|
||||
|
||||
Parallel v2 flow:
|
||||
|
||||
@@ -85,4 +85,16 @@ POST /qft/upload/chunk (parallel, offset based)
|
||||
POST /qft/upload/finish
|
||||
```
|
||||
|
||||
Windows preallocates a `.qftpart`, writes chunks at explicit offsets, verifies SHA-256, then renames to the final file. Per-file worker count is capped at 8; chunk size is selected from 4/8/16 MiB by file size.
|
||||
Windows preallocates a `.qftpart`, writes chunks at explicit offsets, verifies SHA-256, then renames to the final file. Uploads target 8 workers per file (bounded by the usable chunks and device capacity); the requested chunk size is derived from the file size and clamped to **64 KiB–16 MiB**. Repeated chunk and finish requests are idempotent so a lost response can be retried safely.
|
||||
|
||||
## 5. Windows → Android download
|
||||
|
||||
The same QFTPAIR2 local session can declare the download direction. Android discovers and verifies the Windows sender, then downloads `GET /qft/download` with exact single-range requests:
|
||||
|
||||
```text
|
||||
Range: bytes=<start>-<end>
|
||||
```
|
||||
|
||||
The sender returns `206 Partial Content`, the matching `Content-Range`, and the exact requested body length. Android splits the file toward 8 workers with **64 KiB–16 MiB** chunks, stores each completed chunk in a `.qftpart.map` ledger, and resumes only missing chunks after a reconnect. Each range can retry up to five times; the complete partial file must pass SHA-256 before it is published to `Downloads/QFT`.
|
||||
|
||||
For both direct-transfer directions, the Windows listener may accept connections non-blockingly for shutdown responsiveness, but each accepted file socket is switched to blocking I/O with explicit timeouts before reading or writing request bodies. This prevents `WSAEWOULDBLOCK (10035)` from turning an in-progress parallel transfer into an HTTP 500 failure.
|
||||
|
||||
Reference in New Issue
Block a user