mirror of https://bitbucket.org/ausocean/av.git
More elegant switch in parseURL() for port logic.
This commit is contained in:
parent
3a70dc6ddc
commit
2697dcf515
|
@ -99,16 +99,15 @@ func parseURL(addr string) (protocol int32, host string, port uint16, app, playp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if port == 0 {
|
|
||||||
switch {
|
switch {
|
||||||
|
case port != 0:
|
||||||
case (protocol & featureSSL) != 0:
|
case (protocol & featureSSL) != 0:
|
||||||
port = 433
|
return protocol, host, port, app, playpath, errUnimplemented // port = 433
|
||||||
return errUnimplemented
|
|
||||||
case (protocol & featureHTTP) != 0:
|
case (protocol & featureHTTP) != 0:
|
||||||
port = 80
|
port = 80
|
||||||
default:
|
default:
|
||||||
port = 1935
|
port = 1935
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return protocol, host, port, app, playpath, nil
|
return protocol, host, port, app, playpath, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue