File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ use std::net::{SocketAddr, ToSocketAddrs};
6
6
use std:: path:: PathBuf ;
7
7
use std:: process:: { Command , Stdio } ;
8
8
use std:: sync:: atomic:: { AtomicU16 , Ordering } ;
9
+ use std:: thread:: sleep;
10
+ use std:: time:: Duration ;
9
11
use tokio_rustls:: rustls;
10
12
use url:: Url ;
11
13
@@ -201,8 +203,13 @@ fn index_page_unix() {
201
203
"example.com" . try_into ( ) . unwrap ( ) ,
202
204
)
203
205
. unwrap ( ) ;
204
- let mut unix =
205
- std:: os:: unix:: net:: UnixStream :: connect ( sock_path) . expect ( "could not connect unix socket" ) ;
206
+
207
+ let mut unix = loop {
208
+ if let Ok ( sock) = std:: os:: unix:: net:: UnixStream :: connect ( & sock_path) {
209
+ break sock;
210
+ }
211
+ sleep ( Duration :: from_millis ( 10 ) ) ;
212
+ } ;
206
213
let mut tls = rustls:: Stream :: new ( & mut session, & mut unix) ;
207
214
208
215
write ! ( tls, "gemini://example.com\r \n " ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments