File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -419,13 +419,16 @@ impl GeneralList {
419419 }
420420 if let Some ( ( id, text) ) = take_input ( ) {
421421 if id == "mp_addr" {
422+ // TODO: better error handling?
422423 if let Err ( err) = text. to_socket_addrs ( ) {
423- show_error ( anyhow :: Error :: new ( err ) . context ( tl ! ( "item-mp-addr-invalid" ) ) ) ;
424- return Ok ( false ) ;
425- } else {
426- data . config . mp_address = text ;
427- return Ok ( true ) ;
424+ // domain without port, for SRV
425+ if ( text . clone ( ) , 80 ) . to_socket_addrs ( ) . is_err ( ) || text . is_empty ( ) {
426+ show_error ( anyhow :: Error :: new ( err ) . context ( tl ! ( "item-mp-addr-invalid" ) ) ) ;
427+ return Ok ( false ) ;
428+ }
428429 }
430+ data. config . mp_address = text;
431+ return Ok ( true ) ;
429432 } else if id == "anys_gateway" {
430433 if let Err ( err) = Url :: parse ( & text) {
431434 show_error ( anyhow:: Error :: new ( err) . context ( tl ! ( "item-anys-gateway-invalid" ) ) ) ;
You can’t perform that action at this time.
0 commit comments