1
0
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:
Mrs4s 2021-01-08 00:37:50 +08:00
parent a1f7d5962e
commit ce4834c2ba
2 changed files with 2 additions and 0 deletions

View File

@ -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")

View File

@ -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)
}