fixed auth method prefix extra / char

This commit is contained in:
Tamas Elekes 2018-03-02 12:54:09 +01:00
parent b9047f5ea7
commit ab817384b1
2 changed files with 4 additions and 3 deletions

View File

@ -65,7 +65,8 @@ int main()
MyHandler handler(loop);
// make a connection
AMQP::TcpConnection connection(&handler, AMQP::Address("amqp://guest:guest@localhost/"));
AMQP::Address address("amqps://guest:guest@localhost/");
AMQP::TcpConnection connection(&handler, address);
// we need a channel too
AMQP::TcpChannel channel(&connection);

View File

@ -73,7 +73,7 @@ public:
else throw std::runtime_error("AMQP address should start with \"amqp://\" or \"amqps://\"");
// begin of the string was parsed
data += 7;
data += _authmethod.length();
// do we have a '@' to split user-data and hostname?
const char *at = (const char *)memchr(data, '@', last - data);