@@ -69,6 +69,8 @@ pub async fn discover(duration: std::time::Duration) -> Result<StringStream, Err
69
69
let probe = build_probe ( ) ;
70
70
let probe_xml = yaserde:: ser:: to_string ( & probe) . map_err ( Error :: Internal ) ?;
71
71
72
+ debug ! ( "Probe XML: {}" , probe_xml) ;
73
+
72
74
let socket = ( || async {
73
75
const LOCAL_IPV4_ADDR : Ipv4Addr = Ipv4Addr :: UNSPECIFIED ;
74
76
const LOCAL_PORT : u16 = 0 ;
@@ -96,9 +98,10 @@ pub async fn discover(duration: std::time::Duration) -> Result<StringStream, Err
96
98
// Make an async stream of XML's
97
99
futures:: stream:: unfold ( socket, |s| async { Some ( ( recv_string ( & s) . await , s) ) } )
98
100
. filter_map ( |string| async move { string. ok ( ) } )
99
- . filter_map (
100
- |xml| async move { yaserde:: de:: from_str :: < probe_matches:: Envelope > ( & xml) . ok ( ) } ,
101
- )
101
+ . filter_map ( |xml| async move {
102
+ debug ! ( "Probe match XML: {}" , xml) ;
103
+ yaserde:: de:: from_str :: < probe_matches:: Envelope > ( & xml) . ok ( )
104
+ } )
102
105
. filter ( move |envelope| {
103
106
futures:: future:: ready ( envelope. header . relates_to == probe. header . message_id )
104
107
} )
@@ -151,7 +154,11 @@ where
151
154
. filter ( |addr| check_addr ( addr. clone ( ) ) )
152
155
. take ( 1 ) ;
153
156
154
- Box :: pin ( stream) . next ( ) . await
157
+ let addr = Box :: pin ( stream) . next ( ) . await ;
158
+
159
+ debug ! ( "Responding addr: {:?}" , addr) ;
160
+
161
+ addr
155
162
}
156
163
157
164
fn build_probe ( ) -> probe:: Envelope {
0 commit comments