Respect the port number from VoiceServerUpdate (#285)
Some checks failed
CI / Lint (push) Has been cancelled
CI / Test (beta, beta) (push) Has been cancelled
CI / Test (nightly, nightly) (push) Has been cancelled
CI / Test (stable) (push) Has been cancelled
CI / Test (true, Windows, windows-latest) (push) Has been cancelled
CI / Test (true, driver tungstenite rustls, driver only) (push) Has been cancelled
CI / Test (true, gateway serenity tungstenite rustls, gateway only) (push) Has been cancelled
CI / Test (true, macOS, macOS-latest) (push) Has been cancelled
CI / Build docs (push) Has been cancelled
CI / Examples (push) Has been cancelled
Publish docs / Publish docs (push) Has been cancelled
Some checks failed
CI / Lint (push) Has been cancelled
CI / Test (beta, beta) (push) Has been cancelled
CI / Test (nightly, nightly) (push) Has been cancelled
CI / Test (stable) (push) Has been cancelled
CI / Test (true, Windows, windows-latest) (push) Has been cancelled
CI / Test (true, driver tungstenite rustls, driver only) (push) Has been cancelled
CI / Test (true, gateway serenity tungstenite rustls, gateway only) (push) Has been cancelled
CI / Test (true, macOS, macOS-latest) (push) Has been cancelled
CI / Build docs (push) Has been cancelled
CI / Examples (push) Has been cancelled
Publish docs / Publish docs (push) Has been cancelled
This commit is contained in:
@@ -53,12 +53,12 @@ impl Connection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn new_inner(
|
pub(crate) async fn new_inner(
|
||||||
mut info: ConnectionInfo,
|
info: ConnectionInfo,
|
||||||
interconnect: &Interconnect,
|
interconnect: &Interconnect,
|
||||||
config: &Config,
|
config: &Config,
|
||||||
idx: usize,
|
idx: usize,
|
||||||
) -> Result<Connection> {
|
) -> Result<Connection> {
|
||||||
let url = generate_url(&mut info.endpoint)?;
|
let url = generate_url(&info.endpoint)?;
|
||||||
|
|
||||||
let mut client = WsStream::connect(url).await?;
|
let mut client = WsStream::connect(url).await?;
|
||||||
let (ws_msg_tx, ws_msg_rx) = flume::unbounded();
|
let (ws_msg_tx, ws_msg_rx) = flume::unbounded();
|
||||||
@@ -272,7 +272,7 @@ impl Connection {
|
|||||||
|
|
||||||
#[instrument(skip(self))]
|
#[instrument(skip(self))]
|
||||||
pub async fn reconnect_inner(&mut self) -> Result<()> {
|
pub async fn reconnect_inner(&mut self) -> Result<()> {
|
||||||
let url = generate_url(&mut self.info.endpoint)?;
|
let url = generate_url(&self.info.endpoint)?;
|
||||||
|
|
||||||
// Thread may have died, we want to send to prompt a clean exit
|
// Thread may have died, we want to send to prompt a clean exit
|
||||||
// (if at all possible) and then proceed as normal.
|
// (if at all possible) and then proceed as normal.
|
||||||
@@ -331,13 +331,7 @@ impl Drop for Connection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn generate_url(endpoint: &mut String) -> Result<Url> {
|
fn generate_url(endpoint: &str) -> Result<Url> {
|
||||||
if endpoint.ends_with(":80") {
|
|
||||||
let len = endpoint.len();
|
|
||||||
|
|
||||||
endpoint.truncate(len - 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
Url::parse(&format!("wss://{endpoint}/?v={VOICE_GATEWAY_VERSION}")).or(Err(Error::EndpointUrl))
|
Url::parse(&format!("wss://{endpoint}/?v={VOICE_GATEWAY_VERSION}")).or(Err(Error::EndpointUrl))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user