From f9684b73e95a0f52f0049384ea34c2953b3c9200 Mon Sep 17 00:00:00 2001 From: abakum Date: Thu, 21 May 2026 17:35:29 +0300 Subject: [PATCH] feat: skip file info transfer for /dev/null placeholder When the sender has exactly one file and it is /dev/null, skip the file info transfer step. This enables reusing croc's secure tunnel (PAKE + encryption + authentication) for WebDAV or other apps without sending real files through the croc protocol. --- src/croc/croc.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/croc/croc.go b/src/croc/croc.go index e9cba8e39..8f518fcdb 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -1662,6 +1662,15 @@ func (c *Client) processMessage(payload []byte) (done bool, err error) { func (c *Client) updateIfSenderChannelSecured() (err error) { if c.Options.IsSender && c.Step1ChannelSecured && !c.Step2FileInfoTransferred { + + if len(c.FilesToTransfer) == 1 && + c.FilesToTransfer[0].Name == filepath.Base(os.DevNull) && + c.FilesToTransfer[0].FolderSource == filepath.Dir(os.DevNull) { + log.Debug(os.DevNull) + c.Step2FileInfoTransferred = true + return + } + var b []byte machID, _ := machineid.ID() b, err = json.Marshal(SenderInfo{