feat: 统一 Commilitia Drop 全客户端命名与分发

This commit is contained in:
2026-07-31 22:56:10 +08:00
parent f7b0f04c9c
commit c480f0d1c2
77 changed files with 861 additions and 263 deletions
@@ -6,7 +6,7 @@ import WebRTC
// WebKit/libwebrtc desktop/NATIVE-TRANSFER.md §7
//
// 线 desktop/enginepion web/src/features/transfer/p2p.ts pion
// / iOS JS DataChannel "cdrop-file"ordered meta/done/ack
// / iOS JS DataChannel "commilitia-drop-file"ordered
// 64KB payload {type, sdp?, candidate?} session.go +
// engine.go Swift ack
//
@@ -39,7 +39,7 @@ protocol P2PEngineDelegate: AnyObject
private enum Wire
{
static let channelName = "cdrop-file"
static let channelName = "commilitia-drop-file"
static let chunkSize = 64 * 1024
static let highWatermark: UInt64 = 16 * 1024 * 1024
static let lowWatermark: UInt64 = 4 * 1024 * 1024
@@ -94,7 +94,7 @@ final class LibWebRtcEngine
}
// StartOutgoing PeerConnection + DataChannel offer filePath
// filePath cdrop-file://<id> completion offer
// filePath commilitia-drop-file://<id> completion offer
// setLocalDescription JS seed p2pIos.ts chain
func startOutgoing(sessionId: String, peerName: String, filePath: String,
iceServersJSON: String, completion: @escaping (Error?) -> Void)