mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +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 {
|
doUpload := func() error {
|
||||||
defer cond.Signal() // 成功和失败都得提醒一次
|
|
||||||
conn, err := net.DialTimeout("tcp", c.srvSsoAddrs[0], time.Second*20)
|
conn, err := net.DialTimeout("tcp", c.srvSsoAddrs[0], time.Second*20)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "connect error")
|
return errors.Wrap(err, "connect error")
|
||||||
@ -339,13 +338,14 @@ func (c *QQClient) highwayUploadFileMultiThreadingByBDH(path string, cmdId int32
|
|||||||
for i := 0; i < threadCount; i++ {
|
for i := 0; i < threadCount; i++ {
|
||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
|
defer cond.Signal()
|
||||||
if err := doUpload(); err != nil {
|
if err := doUpload(); err != nil {
|
||||||
lastErr = err
|
lastErr = err
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
return rspExt, err
|
return rspExt, lastErr
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *QQClient) highwaySendHeartbreak(conn net.Conn) error {
|
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)
|
ext, _ := proto.Marshal(c.buildPttGroupShortVideoProto(videoHash, thumbHash, groupCode, videoLen, thumbLen).PttShortVideoUploadReq)
|
||||||
var hwRsp []byte
|
var hwRsp []byte
|
||||||
if cache != "" {
|
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 {
|
cp := func() error {
|
||||||
_, err := io.Copy(file, utils.MultiReadSeeker(thumb, video))
|
_, err := io.Copy(file, utils.MultiReadSeeker(thumb, video))
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user