@@ -1112,10 +1112,15 @@ func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params
11121112
11131113 ctx = gax .InsertMetadataIntoOutgoingContext (ctx , contextMetadataFromBidiReadObject (req )... )
11141114
1115- openStream := func () (* bidiReadStreamResponse , context.CancelFunc , error ) {
1115+ openStream := func (readHandle ReadHandle ) (* bidiReadStreamResponse , context.CancelFunc , error ) {
11161116 if err := applyCondsProto ("grpcStorageClient.BidiReadObject" , params .gen , params .conds , r ); err != nil {
11171117 return nil , nil , err
11181118 }
1119+ if readHandle != nil {
1120+ req .GetReadObjectSpec ().ReadHandle = & storagepb.BidiReadHandle {
1121+ Handle : readHandle ,
1122+ }
1123+ }
11191124 var stream storagepb.Storage_BidiReadObjectClient
11201125 var resp * storagepb.BidiReadObjectResponse
11211126 cc , cancel := context .WithCancel (ctx )
@@ -1158,7 +1163,7 @@ func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params
11581163 }
11591164
11601165 // For the first time open stream without adding any range.
1161- resp , cancel , err := openStream ()
1166+ resp , cancel , err := openStream (nil )
11621167 if err != nil {
11631168 return nil , err
11641169 }
@@ -1419,7 +1424,7 @@ func (r *gRPCBidiReader) reopenStream(failSpec []rangeSpec) error {
14191424 r .cancel ()
14201425 }
14211426
1422- res , cancel , err := r .reopen ()
1427+ res , cancel , err := r .reopen (r . readHandle )
14231428 if err != nil {
14241429 return err
14251430 }
@@ -1894,7 +1899,7 @@ type gRPCBidiReader struct {
18941899 settings * settings
18951900 readHandle ReadHandle
18961901 readID int64
1897- reopen func () (* bidiReadStreamResponse , context.CancelFunc , error )
1902+ reopen func (ReadHandle ) (* bidiReadStreamResponse , context.CancelFunc , error )
18981903 readSpec * storagepb.BidiReadObjectSpec
18991904 data chan []rangeSpec
19001905 ctx context.Context
0 commit comments