Skip to content

XDRIVE transport: Carry a Google Drive session in a ring of slots - #7217

Merged
RPRX merged 1 commit into
XTLS:mainfrom
4RH1T3CT0R7:feat/xdrive-slots
Oct 29, 2026
Merged

RPRX merged 1 commit into
XTLS:mainfrom
4RH1T3CT0R7:feat/xdrive-slots

Conversation

@4RH1T3CT0R7

Copy link
Copy Markdown
Contributor

as RPRX asked in #7187, from the work of @Ahmad-2213 in his fork, who is co-author. a google drive session now opens with a ring of 8 slots for each direction, files that both sides know by id from the announcement. segment n goes to slot n % 8 in one patch, of the description up to 14 KiB and of description and body above that, and the reader gets it by id, so nothing is listed and nothing waits for the index of drive. the reader keeps how far it has read in a watermark of the ring, and a slot is written again only once that says what was in it was taken, so a reader that falls behind holds the writer back. template and local storage keep segments, as does a server that gets an announcement without a ring, but a client with this needs a server with it. left out of his branch: the changes to segments, growth by delete latency, hedged listings and mux resume

the live drive test against main over the same link, 8 runs or more each: client to server 1.21 to 0.96 s, server to client 1.17 to 0.9 s, 400 KB 3.4 to 2.9 s, and main lost the first message from server to client in 4 of 13 runs where slots lost none in 23. these are from my pc, do you need them from a vps too

Co-authored-by: Ahmad-2213 <106820058+Ahmad-2213@users.noreply.github.com>
@Ahmad-2213

Ahmad-2213 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Greetings.
@4RH1T3CT0R7 Thank you for reviewing the changes & considering this PR.Though since it's AI written , I don't think anybody would expect much from it & needs professional review, but the idea remains solid.
regarding mux resume, it was my first work & it was intended to address decoupling application session from proxy session for tcp traffic & it's not meant from the first place, to be considered as a PR, however, I've discussed this with @RPRX at #7115 (comment) & in later comments.
I'm saying this to rule out the role of mux resume & other unrelated stuff from xdrive, though i really do think that it's a precious feature & capability; later I'll probably add it to xmux if it was ok; for now, it's handling a simple ws transport for me & fulfills my Goal

@RPRX

RPRX commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

From #7187 (comment) ,这个 PR 看起来需要合并后修一下 fmt,下次记得给 write 权限 @4RH1T3CT0R7


理解了下 #7170 (comment) ,意思是对于 Google Drive 这种特殊情况 #6748 (comment) ,现在改为直接 update 现有文件、从而不需要先发一个请求来获取新文件 ID?确实可以显著降低延迟,话说是不是头部有元数据、发现没更新就不继续下载了?

对于其它 backend #7188 #7231 甚至 "local" 都可以直接拉下一个文件名 #6748 (comment) 来显著降低延迟,不是的话改一下

不确定截至这个 PR 的代码是否含了我提的“segment 自动逐轮增大,对端前一个 segment 下载完紧接着就是下一个、没有间隔(上传、下载都改成 XHTTP packet-up 那种)”,该机制应作用于所有 backend,理论上接近“直接下载大文件”的速度,请 PR

还有件事是 #7187 (comment) 提到的 XDRIVE 直接用的 Go HTTP 而非 x/net,不过强制 Mux 了应该还好,等 Go 1.27.4 再看吧

@RPRX
RPRX merged commit 8de1b69 into XTLS:main Oct 29, 2026
39 of 40 checks passed
RPRX pushed a commit that referenced this pull request Oct 29, 2026
)

#7217 (comment)

---------

Co-authored-by: Ahmad-2213 <106820058+Ahmad-2213@users.noreply.github.com>
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.

3 participants