- s.Logger.Infow("Client folder download action", "action", fmt.Sprintf("%X", readBuffer[0:2]))
+ s.Logger.Infow("Client folder download action", "action", fmt.Sprintf("%X", nextAction[0:2]))
+
+ var dataOffset int64
+
+ switch nextAction[1] {
+ case dlFldrActionResumeFile:
+ // client asked to resume this file
+ var frd FileResumeData
+ // get size of resumeData
+ if _, err := conn.Read(nextAction); err != nil {
+ return err
+ }
+
+ resumeDataLen := binary.BigEndian.Uint16(nextAction)
+ resumeDataBytes := make([]byte, resumeDataLen)
+ if _, err := conn.Read(resumeDataBytes); err != nil {
+ return err
+ }
+
+ if err := frd.UnmarshalBinary(resumeDataBytes); err != nil {
+ return err
+ }
+ dataOffset = int64(binary.BigEndian.Uint32(frd.ForkInfoList[0].DataSize[:]))
+ case dlFldrActionNextFile:
+ // client asked to skip this file
+ return nil
+ }