mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
fix file lock.
This commit is contained in:
parent
a1f7d5962e
commit
ce4834c2ba
@ -249,6 +249,7 @@ func (c *QQClient) highwayUploadFileMultiThreadingByBDH(path string, cmdId int32
|
||||
}
|
||||
defer conn.Close()
|
||||
chunk, _ := os.OpenFile(path, os.O_RDONLY, 0666)
|
||||
defer chunk.Close()
|
||||
reader := binary.NewNetworkReader(conn)
|
||||
if err = c.highwaySendHeartbreak(conn); err != nil {
|
||||
return errors.Wrap(err, "echo error")
|
||||
|
@ -123,6 +123,7 @@ func (c *QQClient) UploadGroupShortVideo(groupCode int64, video, thumb io.ReadSe
|
||||
if err != nil || cp() != nil {
|
||||
hwRsp, err = c.highwayUploadByBDH(utils.MultiReadSeeker(thumb, video), 25, c.highwaySession.SigSession, ext, true)
|
||||
} else {
|
||||
_ = file.Close()
|
||||
hwRsp, err = c.highwayUploadFileMultiThreadingByBDH(cache, 25, 8, c.highwaySession.SigSession, ext, true)
|
||||
_ = os.Remove(cache)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user