@@ -8,7 +8,7 @@ use chrono::{DateTime, Utc};
88use futures:: stream:: BoxStream ;
99use futures_core:: Future ;
1010pub use libsql_replication:: rpc:: replication as rpc;
11- use libsql_replication:: rpc:: replication:: hello_request :: WalFlavor ;
11+ use libsql_replication:: rpc:: replication:: log_offset :: WalFlavor ;
1212use libsql_replication:: rpc:: replication:: replication_log_server:: ReplicationLog ;
1313use libsql_replication:: rpc:: replication:: {
1414 Frame , Frames , HelloRequest , HelloResponse , LogOffset , NAMESPACE_DOESNT_EXIST ,
@@ -260,6 +260,9 @@ impl ReplicationLog for ReplicationLogService {
260260 & self ,
261261 req : tonic:: Request < LogOffset > ,
262262 ) -> Result < tonic:: Response < Self :: LogEntriesStream > , Status > {
263+ if let WalFlavor :: Libsql = req. get_ref ( ) . wal_flavor ( ) {
264+ return Err ( Status :: invalid_argument ( "libsql wal not supported" ) ) ;
265+ }
263266 let namespace = super :: extract_namespace ( self . disable_namespaces , & req) ?;
264267
265268 self . authenticate ( & req, namespace. clone ( ) ) . await ?;
@@ -305,6 +308,9 @@ impl ReplicationLog for ReplicationLogService {
305308 & self ,
306309 req : tonic:: Request < LogOffset > ,
307310 ) -> Result < tonic:: Response < Frames > , Status > {
311+ if let WalFlavor :: Libsql = req. get_ref ( ) . wal_flavor ( ) {
312+ return Err ( Status :: invalid_argument ( "libsql wal not supported" ) ) ;
313+ }
308314 let namespace = super :: extract_namespace ( self . disable_namespaces , & req) ?;
309315 self . authenticate ( & req, namespace. clone ( ) ) . await ?;
310316
@@ -355,11 +361,6 @@ impl ReplicationLog for ReplicationLogService {
355361 guard. insert ( ( replica_addr, namespace. clone ( ) ) ) ;
356362 }
357363 }
358-
359- if let WalFlavor :: Libsql = req. get_ref ( ) . wal_flavor ( ) {
360- return Err ( Status :: invalid_argument ( "libsql wal not supported" ) ) ;
361- }
362-
363364 let ( logger, config, version, _, _) =
364365 self . logger_from_namespace ( namespace, & req, false ) . await ?;
365366
@@ -381,7 +382,12 @@ impl ReplicationLog for ReplicationLogService {
381382 & self ,
382383 req : tonic:: Request < LogOffset > ,
383384 ) -> Result < tonic:: Response < Self :: SnapshotStream > , Status > {
385+ if let WalFlavor :: Libsql = req. get_ref ( ) . wal_flavor ( ) {
386+ return Err ( Status :: invalid_argument ( "libsql wal not supported" ) ) ;
387+ }
388+
384389 let namespace = super :: extract_namespace ( self . disable_namespaces , & req) ?;
390+
385391 self . authenticate ( & req, namespace. clone ( ) ) . await ?;
386392
387393 let ( logger, _, _, stats, _) = self . logger_from_namespace ( namespace, & req, true ) . await ?;
0 commit comments