Skip to content

Commit

Permalink
Only log if MTP Debugging is on
Browse files Browse the repository at this point in the history
Noticed this while testing - probably unnecessarily verbose otherwise. :)
  • Loading branch information
CodyJung authored Nov 4, 2022
1 parent 4e51333 commit c0045d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mtp/mtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,10 @@ func (d *Device) runTransaction(req *Container, rep *Container,
// data packet AND it's 12 bytes, set SeparateHeader to TRUE so we
// correctly send data back to the receiver.
if n == usbHdrLen && len(rest) == 0 && uint32(n) < h.Length {
log.Printf("Device appears to have split header/data. Switch to separate header mode.")
d.SeparateHeader = true
if d.MTPDebug {
log.Printf("Device appears to have split header/data. Switched to separate header mode.")
}
}

// If this was a full packet, or if the packet wasn't full but
Expand Down

0 comments on commit c0045d5

Please sign in to comment.