@@ -4,12 +4,17 @@ import (
4
4
"context"
5
5
"crypto/sha1"
6
6
"fmt"
7
+ "io"
8
+ "net/url"
9
+ "path"
10
+ "strconv"
11
+ "time"
12
+
7
13
"github.com/alist-org/alist/v3/drivers/base"
8
14
"github.com/alist-org/alist/v3/internal/driver"
9
15
"github.com/alist-org/alist/v3/internal/model"
10
16
"github.com/alist-org/alist/v3/internal/op"
11
17
"github.com/alist-org/alist/v3/pkg/http_range"
12
- "github.com/alist-org/alist/v3/pkg/utils"
13
18
"github.com/aws/aws-sdk-go/aws"
14
19
"github.com/aws/aws-sdk-go/aws/credentials"
15
20
"github.com/aws/aws-sdk-go/aws/session"
@@ -19,11 +24,6 @@ import (
19
24
pubUserFile "github.com/city404/v6-public-rpc-proto/go/v6/userfile"
20
25
"github.com/rclone/rclone/lib/readers"
21
26
"github.com/zzzhr1990/go-common-entity/userfile"
22
- "io"
23
- "net/url"
24
- "path"
25
- "strconv"
26
- "time"
27
27
)
28
28
29
29
type HalalCloud struct {
@@ -251,7 +251,6 @@ func (d *HalalCloud) getLink(ctx context.Context, file model.Obj, args model.Lin
251
251
252
252
size := result .FileSize
253
253
chunks := getChunkSizes (result .Sizes )
254
- var finalClosers utils.Closers
255
254
resultRangeReader := func (ctx context.Context , httpRange http_range.Range ) (io.ReadCloser , error ) {
256
255
length := httpRange .Length
257
256
if httpRange .Length >= 0 && httpRange .Start + httpRange .Length >= size {
@@ -269,7 +268,6 @@ func (d *HalalCloud) getLink(ctx context.Context, file model.Obj, args model.Lin
269
268
sha : result .Sha1 ,
270
269
shaTemp : sha1 .New (),
271
270
}
272
- finalClosers .Add (oo )
273
271
274
272
return readers .NewLimitedReadCloser (oo , length ), nil
275
273
}
@@ -281,7 +279,7 @@ func (d *HalalCloud) getLink(ctx context.Context, file model.Obj, args model.Lin
281
279
duration = time .Until (time .Now ().Add (time .Hour ))
282
280
}
283
281
284
- resultRangeReadCloser := & model.RangeReadCloser {RangeReader : resultRangeReader , Closers : finalClosers }
282
+ resultRangeReadCloser := & model.RangeReadCloser {RangeReader : resultRangeReader }
285
283
return & model.Link {
286
284
RangeReadCloser : resultRangeReadCloser ,
287
285
Expiration : & duration ,
0 commit comments