mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +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)
|
||||
fh := h.Sum(nil)
|
||||
_, _ = 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)
|
||||
}
|
||||
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]))
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
return nil, errors.Wrap(err, "upload failed")
|
||||
|
Loading…
x
Reference in New Issue
Block a user