akalend/amqpcpp — Issue #5: A bug of parsing connection string.
Author: lufeng1102
Created: 2011-12-27 11:28:13+00:00
State: open

Bug Description:

An AMQP connection string like this: xunuu:xunuu@192.168.166.62:5672/search

and then i call the printConnect() method of AMQP object , the print result like this:

AMQP connection:
port = 5672
host = 192.168.166.62
vhost = /search
user = xunuu
passw = xunuu

May be the vhost string is *search* , not */search* , plus a backslash from of *search*

-------------------------------

this error is happen from this method in AMQP:

void AMQP::parseHostPort(string hostPortString )

modify the following statement like this:
...
vhost.assign(hostPortString, pos2, hostPortString.size()-pos2);
...
to

vhost.assign(hostPortString, pos2+1, hostPortString.size()-pos2);

use pos2+1 to skip the backslash in front of vhost.