mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
use single thread upload group image.
This commit is contained in:
parent
0d8fb8a8a7
commit
f6579d20cd
@ -183,7 +183,7 @@ func (c *QQClient) highwayUploadFileMultiThreadingByBDH(path string, cmdId int32
|
|||||||
length, _ := io.Copy(h, file)
|
length, _ := io.Copy(h, file)
|
||||||
fh := h.Sum(nil)
|
fh := h.Sum(nil)
|
||||||
_, _ = file.Seek(0, io.SeekStart)
|
_, _ = file.Seek(0, io.SeekStart)
|
||||||
if stat.Size() < 1024*1024*3 {
|
if stat.Size() < 1024*1024*3 || threadCount < 2 {
|
||||||
return c.highwayUploadByBDH(file, length, cmdId, ticket, fh, ext, false)
|
return c.highwayUploadByBDH(file, length, cmdId, ticket, fh, ext, false)
|
||||||
}
|
}
|
||||||
type BlockMetaData struct {
|
type BlockMetaData struct {
|
||||||
|
@ -91,7 +91,7 @@ func (c *QQClient) UploadGroupImageByFile(groupCode int64, path string) (*messag
|
|||||||
c.srvSsoAddrs = append(c.srvSsoAddrs, fmt.Sprintf("%v:%v", binary.UInt32ToIPV4Address(uint32(addr)), rsp.UploadPort[i]))
|
c.srvSsoAddrs = append(c.srvSsoAddrs, fmt.Sprintf("%v:%v", binary.UInt32ToIPV4Address(uint32(addr)), rsp.UploadPort[i]))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if _, err = c.highwayUploadFileMultiThreadingByBDH(path, 2, 4, rsp.UploadKey, EmptyBytes, false); err == nil {
|
if _, err = c.highwayUploadFileMultiThreadingByBDH(path, 2, 1, rsp.UploadKey, EmptyBytes, false); err == nil {
|
||||||
goto ok
|
goto ok
|
||||||
}
|
}
|
||||||
return nil, errors.Wrap(err, "upload failed")
|
return nil, errors.Wrap(err, "upload failed")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user