@@ -1484,7 +1484,7 @@ impl<S: Service> Client<S> {
14841484 // see https://www.iroh.computer/blog/0rtt-api#connect-side
14851485 let buf = rpc:: prepare_write :: < S > ( msg) ?;
14861486 let ( _tx, _rx) = request. write_raw ( & buf) . await ?;
1487- if ! this. 0 . zero_rtt_accepted ( ) . await {
1487+ if this. 0 . zero_rtt_rejected ( ) . await {
14881488 // 0rtt was not accepted, the data is lost, send it again!
14891489 let Request :: Remote ( request) = this. request ( ) . await ? else {
14901490 unreachable ! ( )
@@ -1523,15 +1523,15 @@ impl<S: Service> Client<S> {
15231523 // see https://www.iroh.computer/blog/0rtt-api#connect-side
15241524 let buf = rpc:: prepare_write :: < S > ( msg) ?;
15251525 let ( _tx, rx) = request. write_raw ( & buf) . await ?;
1526- if this. 0 . zero_rtt_accepted ( ) . await {
1527- rx
1528- } else {
1526+ if this. 0 . zero_rtt_rejected ( ) . await {
15291527 // 0rtt was not accepted, the data is lost, send it again!
15301528 let Request :: Remote ( request) = this. request ( ) . await ? else {
15311529 unreachable ! ( )
15321530 } ;
15331531 let ( _tx, rx) = request. write_raw ( & buf) . await ?;
15341532 rx
1533+ } else {
1534+ rx
15351535 }
15361536 . into ( )
15371537 }
@@ -1571,15 +1571,15 @@ impl<S: Service> Client<S> {
15711571 // see https://www.iroh.computer/blog/0rtt-api#connect-side
15721572 let buf = rpc:: prepare_write :: < S > ( msg) ?;
15731573 let ( _tx, rx) = request. write_raw ( & buf) . await ?;
1574- if this. 0 . zero_rtt_accepted ( ) . await {
1575- rx
1576- } else {
1574+ if this. 0 . zero_rtt_rejected ( ) . await {
15771575 // 0rtt was not accepted, the data is lost, send it again!
15781576 let Request :: Remote ( request) = this. request ( ) . await ? else {
15791577 unreachable ! ( )
15801578 } ;
15811579 let ( _tx, rx) = request. write_raw ( & buf) . await ?;
15821580 rx
1581+ } else {
1582+ rx
15831583 }
15841584 . into ( )
15851585 }
@@ -1654,11 +1654,11 @@ impl<M> Clone for ClientInner<M> {
16541654
16551655impl < M > ClientInner < M > {
16561656 #[ allow( dead_code) ]
1657- async fn zero_rtt_accepted ( & self ) -> bool {
1657+ async fn zero_rtt_rejected ( & self ) -> bool {
16581658 match self {
1659- ClientInner :: Local ( _sender) => true ,
1659+ ClientInner :: Local ( _sender) => false ,
16601660 #[ cfg( feature = "rpc" ) ]
1661- ClientInner :: Remote ( remote_connection) => remote_connection. zero_rtt_accepted ( ) . await ,
1661+ ClientInner :: Remote ( remote_connection) => remote_connection. zero_rtt_rejected ( ) . await ,
16621662 #[ cfg( not( feature = "rpc" ) ) ]
16631663 Self :: Remote ( _) => unreachable ! ( ) ,
16641664 }
@@ -1892,10 +1892,10 @@ pub mod rpc {
18921892 & self ,
18931893 ) -> BoxFuture < std:: result:: Result < ( quinn:: SendStream , quinn:: RecvStream ) , RequestError > > ;
18941894
1895- /// Returns whether 0-RTT data was accepted by the server.
1895+ /// Returns whether 0-RTT data was rejected by the server.
18961896 ///
1897- /// For connections that were fully authenticated before allowing to send any data, this should return `true `.
1898- fn zero_rtt_accepted ( & self ) -> BoxFuture < bool > ;
1897+ /// For connections that were fully authenticated before allowing to send any data, this should return `false `.
1898+ fn zero_rtt_rejected ( & self ) -> BoxFuture < bool > ;
18991899 }
19001900
19011901 /// A connection to a remote service.
@@ -1928,8 +1928,8 @@ pub mod rpc {
19281928 } )
19291929 }
19301930
1931- fn zero_rtt_accepted ( & self ) -> BoxFuture < bool > {
1932- Box :: pin ( async { true } )
1931+ fn zero_rtt_rejected ( & self ) -> BoxFuture < bool > {
1932+ Box :: pin ( async { false } )
19331933 }
19341934 }
19351935
@@ -1973,8 +1973,8 @@ pub mod rpc {
19731973 } )
19741974 }
19751975
1976- fn zero_rtt_accepted ( & self ) -> BoxFuture < bool > {
1977- Box :: pin ( async { true } )
1976+ fn zero_rtt_rejected ( & self ) -> BoxFuture < bool > {
1977+ Box :: pin ( async { false } )
19781978 }
19791979 }
19801980
0 commit comments