diff --git a/client/highway.go b/client/highway.go index 6ce7ec80..90c92a2b 100644 --- a/client/highway.go +++ b/client/highway.go @@ -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 { diff --git a/client/image.go b/client/image.go index bfa3102c..fce6383d 100644 --- a/client/image.go +++ b/client/image.go @@ -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")