Antti / rust-amqp

AMQP client in pure rust. Corresponds to rabbitmq spec.
MIT License
249 stars 45 forks source link

Session::open_url hangs #4

Closed divarvel closed 9 years ago

divarvel commented 9 years ago

I'm using the example code from examples/simple.rs

https://gist.github.com/divarvel/d19b0157cfc3f21f4f7a

The line "Openned session" is never printed, no error is displayed.

wireshark shows the connection opening packets, it seems to stop at some point.

2015-07-29-180351_1914x163_scrot

Antti commented 9 years ago

Are you using the latest version (from github)? I've tried running your gist, it complained about the password,

divarvel commented 9 years ago

I didn't put the password in clear in a public gist (I can send it to you if you want to make tests). I've tried it both with the last version published on cargo (0.0.8) and the github version, the same thing happens, it hangs after the Connection Open packet.

Antti commented 9 years ago

Server is expected to send connection.Open-OK, do you have an access to server logs? It maybe that reading_loop has crashed, can you add extern crate env_logger; to your app, call env_logger::init().unwrap(); in main function, and then run program with RUST_LOG=debug env variable, ie: RUST_LOG=debug ./target/debug/examples/simple

divarvel commented 9 years ago

I don't have access to the server logs, I'll try to find more information.

The logs output by rust-ampq are interesting though: the server returns a connection.start message with connection.blocked: true, then the connection fails on a "reset by peer" error, and it makes the reading loop exit. https://gist.github.com/7e207cc110b56d23a368

I'll investigate on why the server does that.

divarvel commented 9 years ago

Interestingly enough, putting a wrong password gives this : (it panicks and crashes the whole program) https://gist.github.com/f6235442013509528fad

divarvel commented 9 years ago

Ok found it, the leading / in the vhost is not removed. I'll write a PR for that. I'll try to also fix the hanging issue, if I can.

Antti commented 9 years ago

Thanks, I also created my own account on cloudamqp so I can test it there myself.