mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-16 04:35:03 +01:00
fix some things
This commit is contained in:
parent
b67c722c19
commit
6f5fef2f23
9 changed files with 55 additions and 55 deletions
|
|
@ -252,7 +252,7 @@ impl Connection {
|
|||
}
|
||||
}
|
||||
|
||||
async fn dispatch_method(&mut self, frame: Frame) -> Result<()> {
|
||||
async fn dispatch_method(&mut self, frame: Frame) -> Result<WaitForBodyStatus> {
|
||||
let method = methods::parse_method(&frame.payload)?;
|
||||
debug!(?method, "Received method");
|
||||
|
||||
|
|
@ -373,15 +373,14 @@ impl Connection {
|
|||
|
||||
let version = &read_header_buf[5..8];
|
||||
|
||||
self.stream
|
||||
.write_all(OWN_PROTOCOL_HEADER)
|
||||
.await
|
||||
.context("write protocol header")?;
|
||||
|
||||
if &read_header_buf[0..5] == b"AMQP\0" && version == SUPPORTED_PROTOCOL_VERSION {
|
||||
debug!(?version, "Version negotiation successful");
|
||||
Ok(())
|
||||
} else {
|
||||
self.stream
|
||||
.write_all(OWN_PROTOCOL_HEADER)
|
||||
.await
|
||||
.context("write protocol header")?;
|
||||
debug!(?version, expected_version = ?SUPPORTED_PROTOCOL_VERSION, "Version negotiation failed, unsupported version");
|
||||
Err(ProtocolError::CloseNow.into())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,8 +38,6 @@ pub async fn do_thing_i_guess(global_data: GlobalData) -> Result<()> {
|
|||
|
||||
let connection = Connection::new(id, stream, connection_handle, global_data.clone());
|
||||
|
||||
tokio::task::Builder::new()
|
||||
.name(&format!("connection {id}"))
|
||||
.spawn(connection.start_connection_processing().instrument(span));
|
||||
tokio::spawn(connection.start_connection_processing().instrument(span));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue