]> git.r.bdr.sh - rbdr/mobius/commitdiff
Fix comments
authorJeff Halter <redacted>
Tue, 30 Jul 2024 22:06:07 +0000 (15:06 -0700)
committerJeff Halter <redacted>
Tue, 30 Jul 2024 22:06:07 +0000 (15:06 -0700)
hotline/file_transfer.go
hotline/file_wrapper.go
internal/mobius/transaction_handlers.go

index b11aeae585c89c7905921a474cd6ed2e3f789ce8..626cfff48823030be76618e1cdcfdc22a556f919 100644 (file)
@@ -366,26 +366,26 @@ func DownloadFolderHandler(rwc io.ReadWriter, fullPath string, fileTransfer *Fil
        // Folder Download flow:
        // 1. Get filePath from the transfer
        // 2. Iterate over files
-       // 3. For each fileWrapper:
-       //       Send fileWrapper header to client
+       // 3. For each file:
+       //       Send file header to client
        // The client can reply in 3 ways:
        //
-       // 1. If type is an odd number (unknown type?), or fileWrapper download for the current fileWrapper is completed:
-       //              client sends []byte{0x00, 0x03} to tell the server to continue to the next fileWrapper
+       // 1. If type is an odd number (unknown type?), or file download for the current file is completed:
+       //              client sends []byte{0x00, 0x03} to tell the server to continue to the next file
        //
-       // 2. If download of a fileWrapper is to be resumed:
+       // 2. If download of a file is to be resumed:
        //              client sends:
        //                      []byte{0x00, 0x02} // download folder action
        //                      [2]byte // Resume data size
-       //                      []byte fileWrapper resume data (see myField_FileResumeData)
+       //                      []byte file resume data (see myField_FileResumeData)
        //
-       // 3. Otherwise, download of the fileWrapper is requested and client sends []byte{0x00, 0x01}
+       // 3. Otherwise, download of the file is requested and client sends []byte{0x00, 0x01}
        //
        // When download is requested (case 2 or 3), server replies with:
-       //                      [4]byte - fileWrapper size
+       //                      [4]byte - file size
        //                      []byte  - Flattened File Object
        //
-       // After every fileWrapper download, client could request next fileWrapper with:
+       // After every file download, client could request next file with:
        //                      []byte{0x00, 0x03}
        //
        // This notifies the server to send the next item header
@@ -670,7 +670,7 @@ func UploadFolderHandler(rwc io.ReadWriter, fullPath string, fileTransfer *FileT
                                }
                        }
 
-                       // Tell client to send next fileWrapper
+                       // Tell client to send next file
                        if _, err := rwc.Write([]byte{0, DlFldrActionNextFile}); err != nil {
                                return err
                        }
index 94b3f03d3062fe7a42c7bd8878753aa8a00c93c2..b13e0dcdbf4ee91f0d62a6bdaeb3b2b0e209f87e 100644 (file)
@@ -178,7 +178,7 @@ func (f *fileWrapper) Move(newPath string) error {
        return nil
 }
 
-// Delete a fileWrapper and its associated metadata files if they exist
+// Delete a file and its associated metadata files if they exist
 func (f *fileWrapper) Delete() error {
        err := f.fs.RemoveAll(f.dataPath)
        if err != nil {
index d18dba51f35b0793a08b3035725ce8eb95517916..cf2357c4e21f5585e85c8f568ef719c7513bdec1 100644 (file)
@@ -418,7 +418,7 @@ func HandleMoveFile(cc *hotline.ClientConn, t *hotline.Transaction) (res []hotli
        if err := hlFile.Move(fileNewPath); err != nil {
                return res
        }
-       // TODO: handle other possible errors; e.g. fileWrapper delete fails due to fileWrapper permission issue
+       // TODO: handle other possible errors; e.g. file delete fails due to permission issue
 
        res = append(res, cc.NewReply(t))
        return res