@@ -40,7 +40,7 @@ use iroh::bytes::get::{fsm, Stats};
40
40
use iroh:: bytes:: protocol:: { AnyGetRequest , GetRequest , RequestToken } ;
41
41
use iroh:: bytes:: provider:: Event as ProviderEvent ;
42
42
use iroh:: bytes:: util:: runtime;
43
- use iroh:: collection:: Collection ;
43
+ use iroh:: collection:: { Collection , IrohCollectionParser } ;
44
44
use iroh:: database:: flat:: DataSource ;
45
45
use iroh:: dial:: Ticket ;
46
46
use iroh:: net:: defaults:: default_derp_map;
@@ -194,12 +194,13 @@ impl BackupProvider {
194
194
let provider = Node :: builder ( db)
195
195
. bind_addr ( ( Ipv4Addr :: UNSPECIFIED , 0 ) . into ( ) )
196
196
. custom_auth_handler ( Arc :: new ( auth_token_handler) )
197
+ . collection_parser ( IrohCollectionParser )
197
198
. runtime ( & rt)
198
199
. spawn ( )
199
200
. await ?;
200
201
context. emit_event ( SendProgress :: ProviderListening . into ( ) ) ;
201
202
info ! ( context, "Waiting for remote to connect" ) ;
202
- let ticket = provider. ticket ( hash, Some ( token) ) . await ? ;
203
+ let ticket = provider. ticket ( hash) . await ? . with_token ( Some ( token) ) ;
203
204
Ok ( ( provider, ticket) )
204
205
}
205
206
@@ -500,7 +501,8 @@ async fn run_get_request(
500
501
ticket : Ticket ,
501
502
) -> anyhow:: Result < Stats > {
502
503
let opts = ticket. as_get_options ( Keypair :: generate ( ) , Some ( default_derp_map ( ) ) ) ;
503
- let request = AnyGetRequest :: Get ( GetRequest :: all ( ticket. hash ( ) ) ) ;
504
+ let request =
505
+ AnyGetRequest :: Get ( GetRequest :: all ( ticket. hash ( ) ) ) . with_token ( ticket. token ( ) . cloned ( ) ) ;
504
506
let connection = iroh:: dial:: dial ( opts) . await ?;
505
507
let initial = fsm:: start ( connection, request) ;
506
508
use fsm:: * ;
0 commit comments