From ab817384b1c507dbf3b10db565e2740f664766b4 Mon Sep 17 00:00:00 2001 From: Tamas Elekes Date: Fri, 2 Mar 2018 12:54:09 +0100 Subject: [PATCH] fixed auth method prefix extra / char --- examples/libev.cpp | 5 +++-- include/amqpcpp/address.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/libev.cpp b/examples/libev.cpp index e4c428d..5893ca4 100644 --- a/examples/libev.cpp +++ b/examples/libev.cpp @@ -65,8 +65,9 @@ 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); diff --git a/include/amqpcpp/address.h b/include/amqpcpp/address.h index 65e17b6..951d3a2 100644 --- a/include/amqpcpp/address.h +++ b/include/amqpcpp/address.h @@ -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);