mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
fix err shadow
This commit is contained in:
parent
27e5ad98c2
commit
a94171c5c4
@ -243,7 +243,6 @@ func (c *QQClient) highwayUploadFileMultiThreadingByBDH(path string, cmdId int32
|
||||
})
|
||||
}
|
||||
doUpload := func() error {
|
||||
defer cond.Signal() // 成功和失败都得提醒一次
|
||||
conn, err := net.DialTimeout("tcp", c.srvSsoAddrs[0], time.Second*20)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "connect error")
|
||||
@ -339,13 +338,14 @@ func (c *QQClient) highwayUploadFileMultiThreadingByBDH(path string, cmdId int32
|
||||
for i := 0; i < threadCount; i++ {
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
defer cond.Signal()
|
||||
if err := doUpload(); err != nil {
|
||||
lastErr = err
|
||||
}
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
return rspExt, err
|
||||
return rspExt, lastErr
|
||||
}
|
||||
|
||||
func (c *QQClient) highwaySendHeartbreak(conn net.Conn) error {
|
||||
|
@ -115,7 +115,8 @@ func (c *QQClient) UploadGroupShortVideo(groupCode int64, video, thumb io.ReadSe
|
||||
ext, _ := proto.Marshal(c.buildPttGroupShortVideoProto(videoHash, thumbHash, groupCode, videoLen, thumbLen).PttShortVideoUploadReq)
|
||||
var hwRsp []byte
|
||||
if cache != "" {
|
||||
file, err := os.OpenFile(cache, os.O_WRONLY|os.O_CREATE, 0666)
|
||||
var file *os.File
|
||||
file, err = os.OpenFile(cache, os.O_WRONLY|os.O_CREATE, 0666)
|
||||
cp := func() error {
|
||||
_, err := io.Copy(file, utils.MultiReadSeeker(thumb, video))
|
||||
return err
|
||||
|
Loading…
x
Reference in New Issue
Block a user